From 3841c59ec034ecfd60d4ea78929a1e8c95abb9bb Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 23 May 2026 03:38:25 -0500 Subject: 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. --- tests/test-custom-case-title-case-region.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test-custom-case-title-case-region.el b/tests/test-custom-case-title-case-region.el index b2d5d1e0..383ae927 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 () -- cgit v1.2.3