Case Conversion Edge Cases: A 16-Sample Determinism Test
Generated outputs for sentence/title/camel/Pascal/snake/kebab/upper conversions covering acronyms, brands, surnames, apostrophes, hyphens, numbers, and non-Latin text.
- Question
- Where is automatic case conversion deterministic yet still semantically wrong for names, brands, and acronyms?
- Samples
- 16 fixtures
- Generated via core
- 16
- Manual / limits
- 0
- Published
- Modified
- Author
- Dionis Ceban
- Method
- Sixteen inputs run through named core functions (toSentenceCase, toTitleCase, toCamelCase, toPascalCase, toSnakeCase, toKebabCase, toUppercase). Outputs are generated—not hand-typed.
Why this test matters
Deterministic transforms still mangle NASA, iPhone, and McDonald-style names. Reviewers need concrete before/after pairs, not slogans.
Tools under test
Result summary
16 of 16 fixtures were executed through assets/js/tools-src/core.js. 0 entries are labeled manual review or limitation without inventing a transform result.
Full test matrix (16 samples)
| ID | Case | Input | Operation | Observed | Status |
|---|---|---|---|---|---|
| case-sentence-01 | Sentence case basic | hello WORLD |
toSentenceCase | Hello world |
Pass |
| case-title-02 | Title case stop-words | the art of the deal |
toTitleCase | The Art Of The Deal |
Pass |
| case-acronym-03 | Acronym risk in title case | NASA launch update |
toTitleCase | Nasa Launch Update |
Pass |
| case-brand-04 | Mixed-case brand | iPhone release notes |
toTitleCase | Iphone Release Notes |
Pass |
| case-surname-05 | Surname McDonald | mcdonald and o’neil |
toTitleCase | Mcdonald And O’Neil |
Pass |
| case-apostrophe-06 | Apostrophe word | it's a writer's tool |
toTitleCase | It's A Writer's Tool |
Pass |
| case-hyphen-07 | Hyphenated words | state-of-the-art design |
toTitleCase | State-Of-The-Art Design |
Pass |
| case-punct-08 | Sentence punctuation | wait. WHAT? now… go! |
toSentenceCase | Wait. What? Now… Go! |
Pass |
| case-camel-09 | to camelCase | customer account id |
toCamelCase | customerAccountId |
Pass |
| case-pascal-10 | to PascalCase | customer account id |
toPascalCase | CustomerAccountId |
Pass |
| case-snake-11 | to snake_case | Customer Account ID |
toSnakeCase | customer_account_id |
Pass |
| case-kebab-12 | to kebab-case | Customer Account ID |
toKebabCase | customer-account-id |
Pass |
| case-numbers-13 | Numbers retained | iso 9001 audit notes |
toTitleCase | Iso 9001 Audit Notes |
Pass |
| case-cyrillic-14 | Non-Latin script | привет мир |
toTitleCase | Привет Мир |
Pass |
| case-ws-15 | Whitespace variations | multi space path |
toCamelCase | multiSpacePath |
Pass |
| case-upper-16 | UPPERCASE | Already Mixed |
toUppercase | ALREADY MIXED |
Pass |
Edge cases and failures
Title case lowercases stop-words mid-phrase but will also reshape acronyms and camel brands unless you intervene.
Conclusion
Trust the transform for mechanical formats (camel/snake/kebab); always re-check acronyms, product brands, and particle surnames after title/sentence case.
Limitations
- No proper-noun dictionary or brand allowlist.
- Apostrophe and hyphen handling follows the core regex, not style-manual exceptions.
- Non-Latin casing depends on Unicode case mapping in the JavaScript engine.
Reproducibility
Re-run npm run guides:evidence and diff expected-results.json. Each fixture names the exact operation used.
Downloadable evidence
- Fixture corpus (JSON) (3.5 KB)
- Observed results (JSON) (5.1 KB)
- case-samples.txt (560 B)