Add substring tests

This commit is contained in:
12pm 2019-03-11 15:00:51 +01:00
parent 3dcb83778f
commit 6086f46bed

View file

@ -19,3 +19,11 @@ TEST(NameBan, Equality)
ASSERT_FALSE(IsNameBanned("def", &Abc0, 1));
ASSERT_FALSE(IsNameBanned("abcdef", &Abc0, 1));
}
TEST(NameBan, Substring)
{
CNameBan Xyz("xyz", 0, 1);
ASSERT_TRUE(IsNameBanned("abcxyz", &Xyz, 1));
ASSERT_TRUE(IsNameBanned("abcxyzdef", &Xyz, 1));
ASSERT_FALSE(IsNameBanned("abcdef", &Xyz, 1));
}