From 2f4e6dd8dfc7e18064e087c65ff9d28b4833cce2 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 15 Sep 2026 00:30:59 +0200 Subject: captures keep the combining marks of a decomposed name; test sources escape invisible characters --- internal/norm/norm_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'internal/norm/norm_test.go') diff --git a/internal/norm/norm_test.go b/internal/norm/norm_test.go index a165b32..dfae915 100644 --- a/internal/norm/norm_test.go +++ b/internal/norm/norm_test.go @@ -75,8 +75,9 @@ func TestFoldASCIINoAlloc(t *testing.T) { } // TestFoldMappedSource: a part of the folded text leads back to the original -// characters it came from, widened to whole characters - so a capture can be -// written with its diacritics. +// characters it came from, widened to whole characters and to the combining +// marks that follow them (a decomposed name, plan 11 review L5) - so a +// capture can be written with its diacritics. func TestFoldMappedSource(t *testing.T) { cases := []struct { in, folded string @@ -86,8 +87,10 @@ func TestFoldMappedSource(t *testing.T) { {"Łódź-faktura.pdf", "Lodz-faktura.pdf", 0, 4, "Łódź"}, {"Łódź-faktura.pdf", "Lodz-faktura.pdf", 5, 12, "faktura"}, {"straße", "strasse", 4, 5, "ß"}, - {"áb", "ab", 0, 1, "a"}, - {"áb", "ab", 1, 2, "b"}, + {"a\u0301b", "ab", 0, 1, "a\u0301"}, + {"e\u0301-x.pdf", "e-x.pdf", 0, 1, "e\u0301"}, + {"\u0141o\u0301dz\u0301-f.pdf", "Lodz-f.pdf", 0, 4, "\u0141o\u0301dz\u0301"}, + {"a\u0301b", "ab", 1, 2, "b"}, {"\xff\xfeé", "�e", 0, 3, "\xff\xfe"}, {"plain.txt", "plain.txt", 0, 5, "plain"}, {"Łódź", "Lodz", 2, 2, ""}, -- cgit v1.3