[CString.StripControls] Srip bg colours when we reset fg

This commit is contained in:
Kyle Fuller
2016-04-11 21:49:03 +01:00
parent ddec5c27ba
commit 032f00732a
2 changed files with 9 additions and 1 deletions

View File

@@ -263,3 +263,11 @@ TEST(StringTest, Contains) {
EXPECT_FALSE(
CString("Hello, I'm Bob").Contains("i'm bob", CString::CaseSensitive));
}
TEST(StringTest, StripControls) {
// Strips reset colours
EXPECT_EQ(CString("\x03test").StripControls(), "test");
// Strips reset foreground and set new background colour
EXPECT_EQ(CString("\x03,03test").StripControls(), "test");
}