diff --git a/tests/zm_utils.cpp b/tests/zm_utils.cpp index 6f4214f8d..887bda45a 100644 --- a/tests/zm_utils.cpp +++ b/tests/zm_utils.cpp @@ -134,3 +134,13 @@ TEST_CASE("split (string delimiter)") { items = split("a b c", " ", 2); REQUIRE(items == std::vector{"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"); +}