WORKED CASE · SYNTHETIC TEST DATA
Check what a character counter counts
Character, word and whitespace counts answer different questions.
Input and settings
Hello worldRun and interpret
Expect eleven code units including space, ten excluding whitespace, and two whitespace-delimited words.
Expected output
11
10
2Scope and possible misuse
Counts use UTF-16 units, not grapheme clusters. Chinese segmentation and linguistic sentence boundaries are not analyzed; reading time is a rough estimate.