summaryrefslogtreecommitdiffstats
path: root/configutil/src/tests/tags/tags_test.cpp
blob: 4b5d008a4262a6fe1d6f46c514656fa13b0c017e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. 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(); }