Harden item occurrence grounding

This commit is contained in:
2026-08-06 13:37:21 +00:00
parent 8cf03a2a44
commit 4192aa8584
16 changed files with 152 additions and 121 deletions

View File

@@ -9,30 +9,6 @@ import (
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
)
func TestComparisonKeyNormalizesSupportedEquivalences(t *testing.T) {
tests := []struct {
name string
left string
right string
}{
{name: "case", left: "Captain Vale", right: "cAPtAiN vALE"},
{name: "compatibility", left: "", right: "Ally"},
{name: "whitespace", left: " Mira\u2003Thorn ", right: "Mira Thorn"},
{name: "apostrophe", left: "ORin", right: "o'Rin"},
{name: "modifier apostrophe", left: "OʼRin", right: "o'Rin"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if ComparisonKey(test.left) != ComparisonKey(test.right) {
t.Fatalf("ComparisonKey(%q) = %q, ComparisonKey(%q) = %q", test.left, ComparisonKey(test.left), test.right, ComparisonKey(test.right))
}
})
}
if ComparisonKey("Mira Thorn") == ComparisonKey("Mira Thorne") {
t.Fatal("different names received the same comparison key")
}
}
func TestNormalizeDisplayOnlyChangesWhitespace(t *testing.T) {
if got := NormalizeDisplay(" ORin\u2003Thorn "); got != "ORin Thorn" {
t.Fatalf("NormalizeDisplay() = %q", got)