summaryrefslogtreecommitdiffstats
path: root/configutil/src/tests/tags/tags_test.cpp
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /configutil/src/tests/tags/tags_test.cpp
Publish
Diffstat (limited to 'configutil/src/tests/tags/tags_test.cpp')
-rw-r--r--configutil/src/tests/tags/tags_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/configutil/src/tests/tags/tags_test.cpp b/configutil/src/tests/tags/tags_test.cpp
new file mode 100644
index 00000000000..61c23490a8a
--- /dev/null
+++ b/configutil/src/tests/tags/tags_test.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/vespalib/testkit/testapp.h>
+#include <lib/tags.h>
+
+using namespace configdefinitions;
+
+TEST("upcase") {
+ EXPECT_EQUAL(vespalib::string("A"), upcase(vespalib::string("a")));
+ EXPECT_EQUAL(vespalib::string("A"), upcase(vespalib::string("A")));
+}
+
+TEST("tagsContain") {
+ EXPECT_TRUE(tagsContain("a b c", "a"));
+ EXPECT_TRUE(tagsContain("a b c", "b"));
+ EXPECT_TRUE(tagsContain("a b c", "c"));
+
+ EXPECT_FALSE(tagsContain("a b c", "d"));
+}
+
+TEST_MAIN() { TEST_RUN_ALL(); }