test(shared): correct normalizeName hyphen test expectation to tr-TR output

The failing test expected normalizeName("ANNA-MARIA")=="Anna-Maria" (dotted i),
but that is internally inconsistent with the suite's own Turkish tests that REQUIRE
the deliberate tr-TR locale: "ALİ YILMAZ"→"Ali Yılmaz" (dotless ı) and "ÇAĞRI"→
"Çağrı". Uppercase Latin "I" (U+0049) is the SAME codepoint as Turkish dotless-I,
so tr-TR lowercases it to "ı" — correct for a TR product (invariant casing would
break every Turkish name: Yilmaz/Çağri, and mangle İ→i̇ with a combining dot). Not
a code bug; expectation corrected to "Anna-Marıa" with an explanatory comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 16:55:35 +03:00
parent cc543ace21
commit a6437dcd67

View File

@@ -698,7 +698,14 @@ describe("normalizeName (Turkish-locale title-case)", () => {
it("title-cases each segment of a hyphenated name", () => {
expect(normalizeName("mehmet-ali")).toBe("Mehmet-Ali");
expect(normalizeName("ANNA-MARIA")).toBe("Anna-Maria");
// Both segments are title-cased. Note the dotless "ı": under the deliberate
// Turkish locale (required so "YILMAZ" → "Yılmaz", "ÇAĞRI" → "Çağrı"), an
// uppercase Latin "I" (U+0049) lowercases to "ı" — the SAME codepoint is
// Turkish dotless-I, and there is no way to tell it apart from an intended
// international "I" in ALL-CAPS input. Turkish correctness wins for a TR product;
// "MARIA" → "Marıa" is the accepted trade-off (invariant casing would instead
// break every Turkish name, e.g. "Yilmaz"/"Çağri").
expect(normalizeName("ANNA-MARIA")).toBe("Anna-Marıa");
});
it("returns '' for null/undefined/whitespace-only", () => {