summaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
Diffstat (limited to 'test/core')
-rw-r--r--test/core/common/UtilsTest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/core/common/UtilsTest.cpp b/test/core/common/UtilsTest.cpp
index 6b8a916..a4bf4b2 100644
--- a/test/core/common/UtilsTest.cpp
+++ b/test/core/common/UtilsTest.cpp
@@ -65,5 +65,22 @@ TEST(Utils, extractFileExtension)
ASSERT_EQ("ext", Utils::extractFileExtension("foo.bar/test.EXT"));
}
+TEST(Utils, startsWith)
+{
+ ASSERT_TRUE(Utils::startsWith("foobar", "foo"));
+ ASSERT_TRUE(Utils::startsWith("foo", "foo"));
+ ASSERT_FALSE(Utils::startsWith("foo", "foobar"));
+ ASSERT_FALSE(Utils::startsWith("foobar", "bar"));
+ ASSERT_TRUE(Utils::startsWith("foo", ""));
+}
+
+TEST(Utils, endsWith)
+{
+ ASSERT_FALSE(Utils::endsWith("foobar", "foo"));
+ ASSERT_TRUE(Utils::endsWith("foo", "foo"));
+ ASSERT_FALSE(Utils::endsWith("foo", "foobar"));
+ ASSERT_TRUE(Utils::endsWith("foobar", "bar"));
+ ASSERT_TRUE(Utils::endsWith("foo", ""));
+}
}