From b075ea6eb98ac27f95bad3c6a9c49c3b769b37e8 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 24 Jun 2019 00:14:39 -0400 Subject: [PATCH] use regular Skeleton instead of SkeletonTweaked dan: "I probably wouldn't expect those mappings to cause much trouble at all for legitimate users at the end of the day" shivaram: [concurs] --- irc/strings.go | 2 +- irc/strings_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/irc/strings.go b/irc/strings.go index d0bbf8b1..c665dca5 100644 --- a/irc/strings.go +++ b/irc/strings.go @@ -148,7 +148,7 @@ func Skeleton(name string) (string, error) { // same as PRECIS: name = width.Fold.String(name) - name = confusables.SkeletonTweaked(name) + name = confusables.Skeleton(name) // internationalized lowercasing for skeletons; this is much more lenient than // Casefold. In particular, skeletons are expected to mix scripts (which may diff --git a/irc/strings_test.go b/irc/strings_test.go index b24bf08d..d1e8b76c 100644 --- a/irc/strings_test.go +++ b/irc/strings_test.go @@ -153,15 +153,15 @@ func TestSkeleton(t *testing.T) { return skel } - if skeleton("warning") == skeleton("waming") { - t.Errorf("Oragono shouldn't consider rn confusable with m") + if skeleton("warning") != skeleton("waming") { + t.Errorf("i give up, Oragono should consider rn confusable with m") } if skeleton("Phi|ip") != "philip" { t.Errorf("but we still consider pipe confusable with l") } - if skeleton("smt") != "smt" { + if skeleton("smt") != skeleton("smt") { t.Errorf("fullwidth characters should skeletonize to plain old ascii characters") } @@ -169,7 +169,7 @@ func TestSkeleton(t *testing.T) { t.Errorf("after skeletonizing, we should casefold") } - if skeleton("smt") != "smt" { + if skeleton("smt") != skeleton("smt") { t.Errorf("our friend lover successfully tricked the skeleton algorithm!") }