summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-22 23:02:33 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-22 23:02:33 +0100
commit266fbfc4b1d80713f0802f8ee18ec4ab7b5887d8 (patch)
tree09c6974169ec5097fe6563fbb0315a19045bbabc /test
parentfcae5902752245e87b9f92583d7ab585555460cb (diff)
Added test for collapse and trim methods in Utils
Diffstat (limited to 'test')
-rw-r--r--test/core/common/UtilsTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/core/common/UtilsTest.cpp b/test/core/common/UtilsTest.cpp
index 7801296..4bf1587 100644
--- a/test/core/common/UtilsTest.cpp
+++ b/test/core/common/UtilsTest.cpp
@@ -109,5 +109,26 @@ TEST(Utils, endsWith)
ASSERT_TRUE(Utils::endsWith("foo", ""));
}
+TEST(Utils, trim)
+{
+ ASSERT_EQ("", Utils::trim(""));
+ ASSERT_EQ("", Utils::trim(" "));
+ ASSERT_EQ("test", Utils::trim("test"));
+ ASSERT_EQ("test", Utils::trim(" test "));
+ ASSERT_EQ("test", Utils::trim(" test"));
+ ASSERT_EQ("test", Utils::trim("test "));
+ ASSERT_EQ("long test", Utils::trim(" long test "));
+}
+
+TEST(Utils, collapse)
+{
+ ASSERT_EQ("", Utils::collapse(""));
+ ASSERT_EQ("", Utils::collapse(" "));
+ ASSERT_EQ("test", Utils::collapse("test"));
+ ASSERT_EQ("test", Utils::collapse(" test "));
+ ASSERT_EQ("test", Utils::collapse(" test"));
+ ASSERT_EQ("test", Utils::collapse("test "));
+ ASSERT_EQ("long test", Utils::collapse(" long test "));
}
+} \ No newline at end of file