summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/StringUtilTest.cpp
diff options
context:
space:
mode:
authorSepalani <sepalani@hotmail.fr>2016-12-06 15:43:41 +0000
committerSepalani <sepalani@hotmail.fr>2016-12-18 00:27:10 +0000
commita6114bad34f85eae346d2c7eec8d2f35c1728cf9 (patch)
tree4ddfb7c3801442ebdf9b011ccfceb2bb272b3735 /Source/UnitTests/Common/StringUtilTest.cpp
parentf431b18675fc2df846a1d142c1d7a793bd1d1175 (diff)
Import/Export signature files as CSV
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
-rw-r--r--Source/UnitTests/Common/StringUtilTest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp
index 603c99d80c..0a45c3b26a 100644
--- a/Source/UnitTests/Common/StringUtilTest.cpp
+++ b/Source/UnitTests/Common/StringUtilTest.cpp
@@ -16,3 +16,27 @@ TEST(StringUtil, JoinStrings)
EXPECT_EQ("a, bb, c", JoinStrings({"a", "bb", "c"}, ", "));
EXPECT_EQ("???", JoinStrings({"?", "?"}, "?"));
}
+
+TEST(StringUtil, StringBeginsWith)
+{
+ EXPECT_EQ(true, StringBeginsWith("abc", "a"));
+ EXPECT_EQ(false, StringBeginsWith("abc", "b"));
+ EXPECT_EQ(true, StringBeginsWith("abc", "ab"));
+ EXPECT_EQ(false, StringBeginsWith("a", "ab"));
+ EXPECT_EQ(false, StringBeginsWith("", "a"));
+ EXPECT_EQ(false, StringBeginsWith("", "ab"));
+ EXPECT_EQ(true, StringBeginsWith("abc", ""));
+ EXPECT_EQ(true, StringBeginsWith("", ""));
+}
+
+TEST(StringUtil, StringEndsWith)
+{
+ EXPECT_EQ(true, StringEndsWith("abc", "c"));
+ EXPECT_EQ(false, StringEndsWith("abc", "b"));
+ EXPECT_EQ(true, StringEndsWith("abc", "bc"));
+ EXPECT_EQ(false, StringEndsWith("a", "ab"));
+ EXPECT_EQ(false, StringEndsWith("", "a"));
+ EXPECT_EQ(false, StringEndsWith("", "ab"));
+ EXPECT_EQ(true, StringEndsWith("abc", ""));
+ EXPECT_EQ(true, StringEndsWith("", ""));
+}