Fix spurious bidi rule violations in casefolding channel names
by stripping the # before starting the casefolding.
This commit is contained in:
Shivaram Lingamneni 2018-12-05 22:35:36 -05:00
parent 70364f5f67
commit 40e63dbbe8
2 changed files with 25 additions and 7 deletions

View file

@ -40,10 +40,21 @@ func TestCasefoldChannel(t *testing.T) {
channel: "#",
folded: "#",
},
{
channel: "#中文频道",
folded: "#中文频道",
},
{
// Hebrew; it's up to the client to display this right-to-left, including the #
channel: "#שלום",
folded: "#שלום",
},
}
for _, errCase := range []string{
"", "#*starpower", "# NASA", "#interro?", "OOF#", "foo",
// bidi violation mixing latin and hebrew characters:
"#shalomעליכם",
} {
testCases = append(testCases, channelTest{channel: errCase, err: true})
}