Fix GetText() for CTCP [ACTION]

Just like the recent problem with smileys; TrimLeft() is not the same
than TrimPrefix(), and TrimRight() is not the same than TrimSuffix().
This commit is contained in:
J-P Nurmi
2015-08-23 00:48:35 +02:00
parent 6e15ee2eea
commit e1ae565e6f
2 changed files with 8 additions and 8 deletions

View File

@@ -56,11 +56,11 @@ TEST(MessageTest, FormatFlags) {
}
TEST(MessageTest, ChanAction) {
CMessage msg(":sender PRIVMSG #chan :\001ACTION text\001");
CMessage msg(":sender PRIVMSG #chan :\001ACTION ACTS\001");
CChanAction& chan = static_cast<CChanAction&>(msg);
EXPECT_EQ("sender", chan.GetNick().GetNick());
EXPECT_EQ("PRIVMSG", chan.GetCommand());
EXPECT_EQ("text", chan.GetText());
EXPECT_EQ("ACTS", chan.GetText());
chan.SetText("foo bar");
EXPECT_EQ("foo bar", chan.GetText());
@@ -139,11 +139,11 @@ TEST(MessageTest, Part) {
}
TEST(MessageTest, PrivAction) {
CMessage msg(":sender PRIVMSG receiver :\001ACTION text\001");
CMessage msg(":sender PRIVMSG receiver :\001ACTION ACTS\001");
CPrivAction& priv = static_cast<CPrivAction&>(msg);
EXPECT_EQ("sender", priv.GetNick().GetNick());
EXPECT_EQ("PRIVMSG", priv.GetCommand());
EXPECT_EQ("text", priv.GetText());
EXPECT_EQ("ACTS", priv.GetText());
priv.SetText("foo bar");
EXPECT_EQ("foo bar", priv.GetText());