tests/utils: Add tests for join
This commit is contained in:
parent
e54c10fdb4
commit
bbc4afcf1b
|
@ -134,3 +134,13 @@ TEST_CASE("split (string delimiter)") {
|
||||||
items = split("a b c", " ", 2);
|
items = split("a b c", " ", 2);
|
||||||
REQUIRE(items == std::vector<std::string>{"a", "b c"});
|
REQUIRE(items == std::vector<std::string>{"a", "b c"});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("join") {
|
||||||
|
REQUIRE(join({}, "") == "");
|
||||||
|
REQUIRE(join({}, " ") == "");
|
||||||
|
REQUIRE(join({""}, "") == "");
|
||||||
|
REQUIRE(join({"a"}, "") == "a");
|
||||||
|
REQUIRE(join({"a"}, ",") == "a");
|
||||||
|
REQUIRE(join({"a", "b"}, ",") == "a,b");
|
||||||
|
REQUIRE(join({"a", "b"}, "") == "ab");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue