summaryrefslogtreecommitdiff
path: root/test/core/common
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-21 01:17:49 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-21 01:17:49 +0100
commit6decad0b8e7e369bd8215f31a45dd3eae982d2a9 (patch)
tree96d22db47629956c554d11a9e56bc68a2fc9b40b /test/core/common
parent311a770805dff2cdffc1ecbfbbf0c5aae44c8878 (diff)
Some further refactoring -- renamed Scope to ParserScope, got rid of parser namespace, added new functionality to RegistryClass, wrote documentation, added function for extracting file extensions to Utils
Diffstat (limited to 'test/core/common')
-rw-r--r--test/core/common/UtilsTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/core/common/UtilsTest.cpp b/test/core/common/UtilsTest.cpp
index 53beb79..c8f6922 100644
--- a/test/core/common/UtilsTest.cpp
+++ b/test/core/common/UtilsTest.cpp
@@ -54,5 +54,24 @@ TEST(Utils, split)
ASSERT_EQ(std::vector<std::string>({"", "a", "be", "c", ""}),
Utils::split(".a.be.c.", '.'));
}
+
+TEST(Utils, toLower)
+{
+ ASSERT_EQ("", Utils::toLower(""));
+ ASSERT_EQ("foo00", Utils::toLower("foo00"));
+ ASSERT_EQ("foo00", Utils::toLower("fOO00"));
+}
+
+TEST(Utils, extractFileExtension)
+{
+ ASSERT_EQ("", Utils::extractFileExtension(""));
+ ASSERT_EQ("", Utils::extractFileExtension("test"));
+ ASSERT_EQ("ext", Utils::extractFileExtension("test.ext"));
+ ASSERT_EQ("", Utils::extractFileExtension("foo.bar/test"));
+ ASSERT_EQ("", Utils::extractFileExtension("foo.bar\\test"));
+ ASSERT_EQ("ext", Utils::extractFileExtension("foo.bar/test.ext"));
+ ASSERT_EQ("ext", Utils::extractFileExtension("foo.bar/test.EXT"));
+}
+
}