From ea80856073d4896da5df78d60369b327346a0b56 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sat, 11 Oct 2025 19:30:36 +0800 Subject: Split and log debug tag. --- test/base/StringUtilTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/base/StringUtilTest.cpp') diff --git a/test/base/StringUtilTest.cpp b/test/base/StringUtilTest.cpp index 1da6e963..6b826d74 100644 --- a/test/base/StringUtilTest.cpp +++ b/test/base/StringUtilTest.cpp @@ -6,6 +6,14 @@ using cru::Index; using cru::k_invalid_code_point; +TEST_CASE("StringUtil Split", "[string]") { + using cru::Split; + REQUIRE(Split("abc", "b") == std::vector{"a", "c"}); + REQUIRE(Split("abcd", "bc") == std::vector{"a", "d"}); + REQUIRE(Split("abcdbcd", "bc") == std::vector{"a", "d", "d"}); + REQUIRE(Split("aaa", "a") == std::vector{"", "", "", ""}); +} + TEST_CASE("StringUtil Utf8NextCodePoint", "[string]") { using cru::Utf8NextCodePoint; std::string_view text = "aπ你🤣!"; -- cgit v1.2.3