Commit 5b80172
committed
fix: ensure UpperCaseWord preserves case in Verbatim mode
Previously, `UpperCaseWord` was forcibly lowercased in `WordsToFormattedCase`
when no specific casing option (like `CMScreaming` or `CMWhispering`) was provided.
This contradicted the behavior of `AcronymWord` and `ExactCaseWord`, which preserve
case in default/Verbatim mode.
This commit removes the fallback lowercasing for `UpperCaseWord`, ensuring that
`ToSnakeCase` and other formatters produce consistent results when `SmartAcronyms`
is disabled (which causes uppercase tokens to be classified as `UpperCaseWord`).
Added regression test `TestUpperCaseWord_Verbatim_Bug` in `types_test.go`.1 parent 48b990b commit 5b80172
2 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
391 | 389 | | |
392 | 390 | | |
393 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
| |||
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
0 commit comments