diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-23 03:38:25 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-23 03:38:25 -0500 |
| commit | f0d9be8fff511700e27638dc00d1e86db446e4b8 (patch) | |
| tree | f5ae271afbdc4ca0fbfc8b7e363a7fa96c3c5989 /tests | |
| parent | fea97e1694e9ed72372b381c63ccbf1c872fd73c (diff) | |
| download | dotemacs-f0d9be8fff511700e27638dc00d1e86db446e4b8.tar.gz dotemacs-f0d9be8fff511700e27638dc00d1e86db446e4b8.zip | |
test(custom-case): cover leading-quote, paren, and RTL title-case edges
The state machine in cj/title-case-region skips leading non-word characters and passes caseless letters through, but no test pinned that. I added three boundary cases: a leading double-quote and a leading paren each still capitalize the first real word, and a caseless RTL first word (Hebrew) passes through while consuming the is-first slot, so the following minor word stays lowercase.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-custom-case-title-case-region.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-custom-case-title-case-region.el b/tests/test-custom-case-title-case-region.el index b2d5d1e0f..383ae927b 100644 --- a/tests/test-custom-case-title-case-region.el +++ b/tests/test-custom-case-title-case-region.el @@ -185,6 +185,22 @@ Note: 'is' is explicitly in the minor word list, so it stays lowercase." "the lord of the rings: the return of the king") "The Lord of the Rings: The Return of the King"))) +(ert-deftest test-custom-case-title-case-region-boundary-leading-quote () + "A leading quote is skipped; the first real word is still capitalized." + (should (equal (test-title-case--on-string "\"the quick brown fox\"") + "\"The Quick Brown Fox\""))) + +(ert-deftest test-custom-case-title-case-region-boundary-leading-paren () + "A leading paren is skipped; the first real word is still capitalized." + (should (equal (test-title-case--on-string "(the lazy dog)") + "(The Lazy Dog)"))) + +(ert-deftest test-custom-case-title-case-region-boundary-rtl-first-word () + "A caseless RTL first word passes through and consumes the is-first slot, +so the following minor word stays lowercase." + (should (equal (test-title-case--on-string "שלום the world") + "שלום the World"))) + ;;; Error Cases (ert-deftest test-custom-case-title-case-region-error-numeric-only () |
