mirror of
https://github.com/znc/znc.git
synced 2026-05-05 13:02:31 +02:00
[CString.StripControls] Srip bg colours when we reset fg
This commit is contained in:
@@ -1413,7 +1413,7 @@ CString CString::StripControls_n() const {
|
||||
digits++;
|
||||
continue;
|
||||
}
|
||||
if (ch == ',' && !comma && digits > 0) {
|
||||
if (ch == ',' && !comma) {
|
||||
comma = true;
|
||||
digits = 0;
|
||||
continue;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user