diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-14 23:50:11 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-14 23:50:11 +0100 |
commit | 295783320ea3855a14123f9cea163f8f5f689e07 (patch) | |
tree | f3f536f36910cce7ef8f30846b10fcb93f32b646 /test | |
parent | ce5ab62b564476dfacba33507f1541166fda2bfb (diff) |
Moved some of the whitespace functionality back to Utils
Diffstat (limited to 'test')
-rw-r--r-- | test/core/common/UtilsTest.cpp | 17 |
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", "")); +} } |