Skip to content

Commit 96a8fd9

Browse files
tobixenclaude
andcommitted
Fix PyICU tests to use case_sensitive=False with UNICODE/LOCALE collations
The 0.5.0 refactoring changed UNICODE and LOCALE collations to default to case_sensitive=True. The PyICU tests were expecting case-insensitive behavior but weren't explicitly setting case_sensitive=False, causing failures in CI where PyICU is installed. Updated tests: - test_pyicu_unicode_collation_with_pyicu - test_pyicu_locale_collation_with_pyicu - test_unicode_collation_case_insensitive (parameterized) - test_turkish_i_requires_locale - test_locale_specific_collation_turkish All tests now explicitly set case_sensitive=False when expecting case-insensitive matching with UNICODE/LOCALE collations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 22290b3 commit 96a8fd9

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

tests/test_collation.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def test_pyicu_unicode_collation_with_pyicu() -> None:
250250

251251
searcher = Searcher(event=True)
252252
searcher.add_property_filter(
253-
"SUMMARY", "test", operator="contains", collation=Collation.UNICODE
253+
"SUMMARY", "test", operator="contains", collation=Collation.UNICODE, case_sensitive=False
254254
)
255255

256256
result = searcher.check_component(event)
@@ -267,7 +267,12 @@ def test_pyicu_locale_collation_with_pyicu() -> None:
267267

268268
searcher = Searcher(event=True)
269269
searcher.add_property_filter(
270-
"SUMMARY", "müller", operator="contains", collation=Collation.LOCALE, locale="de_DE"
270+
"SUMMARY",
271+
"müller",
272+
operator="contains",
273+
collation=Collation.LOCALE,
274+
locale="de_DE",
275+
case_sensitive=False,
271276
)
272277

273278
result = searcher.check_component(event)

tests/test_unicode.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def test_unicode_collation_case_insensitive(self, text: str, search: str) -> Non
442442
cal = make_event(text)
443443
searcher = Searcher()
444444
searcher.add_property_filter(
445-
"SUMMARY", search, operator="==", collation=Collation.UNICODE
445+
"SUMMARY", search, operator="==", collation=Collation.UNICODE, case_sensitive=False
446446
)
447447
result = searcher.check_component(cal)
448448
# With UNICODE collation, case-insensitive matching should work
@@ -461,7 +461,11 @@ def test_turkish_i_requires_locale(self) -> None:
461461
# Turkish İ is U+0130, which is distinct from ASCII i (U+0069)
462462
searcher_unicode = Searcher()
463463
searcher_unicode.add_property_filter(
464-
"SUMMARY", "istanbul", operator="==", collation=Collation.UNICODE
464+
"SUMMARY",
465+
"istanbul",
466+
operator="==",
467+
collation=Collation.UNICODE,
468+
case_sensitive=False,
465469
)
466470
result_unicode = searcher_unicode.check_component(cal)
467471
# Root locale doesn't do Turkish-specific case folding
@@ -470,7 +474,12 @@ def test_turkish_i_requires_locale(self) -> None:
470474
# With Turkish locale, İ DOES match i
471475
searcher_turkish = Searcher()
472476
searcher_turkish.add_property_filter(
473-
"SUMMARY", "istanbul", operator="==", collation=Collation.LOCALE, locale="tr_TR"
477+
"SUMMARY",
478+
"istanbul",
479+
operator="==",
480+
collation=Collation.LOCALE,
481+
locale="tr_TR",
482+
case_sensitive=False,
474483
)
475484
result_turkish = searcher_turkish.check_component(cal)
476485
assert result_turkish, "Turkish locale should match İ with i"
@@ -514,6 +523,7 @@ def test_locale_specific_collation_turkish(self) -> None:
514523
operator="==",
515524
collation=Collation.LOCALE,
516525
locale="tr_TR",
526+
case_sensitive=False,
517527
)
518528
# With Turkish locale, İ lowercases to i, I lowercases to ı
519529
result = searcher.check_component(cal_i_dotted)

0 commit comments

Comments
 (0)