aboutsummaryrefslogtreecommitdiff
path: root/internal/norm/norm_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:30:59 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-15 00:30:59 +0200
commit2f4e6dd8dfc7e18064e087c65ff9d28b4833cce2 (patch)
tree7ebcbec83f0f6ee41d8541bfbcff18eba7af10fa /internal/norm/norm_test.go
parent17e933a16ff7de1b06d62504e78c40e615c8b553 (diff)
downloadkrino-2f4e6dd8dfc7e18064e087c65ff9d28b4833cce2.tar.gz
krino-2f4e6dd8dfc7e18064e087c65ff9d28b4833cce2.zip
captures keep the combining marks of a decomposed name; test sources escape invisible characters
Diffstat (limited to 'internal/norm/norm_test.go')
-rw-r--r--internal/norm/norm_test.go11
1 files changed, 7 insertions, 4 deletions
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, ""},