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