diff options
-rw-r--r-- | core/fxcrt/bytestring_unittest.cpp | 7 | ||||
-rw-r--r-- | core/fxcrt/widestring_unittest.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/fxcrt/bytestring_unittest.cpp b/core/fxcrt/bytestring_unittest.cpp index 7095a1b799..abc3648f18 100644 --- a/core/fxcrt/bytestring_unittest.cpp +++ b/core/fxcrt/bytestring_unittest.cpp @@ -390,6 +390,13 @@ TEST(ByteString, OperatorNE) { EXPECT_TRUE(c_string3 != byte_string); } +TEST(ByteString, OperatorPlus) { + EXPECT_EQ("I like dogs", "I like " + ByteString("dogs")); + EXPECT_EQ("Dogs like me", ByteString("Dogs") + " like me"); + EXPECT_EQ("Oh no, error number 42", + "Oh no, error number " + ByteString::Format("%d", 42)); +} + TEST(ByteString, Concat) { ByteString fred; fred.Concat("FRED", 4); diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp index 37d4ecd581..9017fe0c54 100644 --- a/core/fxcrt/widestring_unittest.cpp +++ b/core/fxcrt/widestring_unittest.cpp @@ -395,6 +395,13 @@ TEST(WideString, OperatorNE) { EXPECT_TRUE(c_string3 != wide_string); } +TEST(WideString, OperatorPlus) { + EXPECT_EQ(L"I like dogs", L"I like " + WideString(L"dogs")); + EXPECT_EQ(L"Dogs like me", WideString(L"Dogs") + L" like me"); + EXPECT_EQ(L"Oh no, error number 42", + L"Oh no, error number " + WideString::Format(L"%d", 42)); +} + TEST(WideString, ConcatInPlace) { WideString fred; fred.Concat(L"FRED", 4); |