From f3af6c7e5b46f4209a4981e5d7be217368f40b15 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 8 Feb 2024 15:12:29 +0800 Subject: Get rid of GSL. --- test/common/StringUtilTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/common/StringUtilTest.cpp') diff --git a/test/common/StringUtilTest.cpp b/test/common/StringUtilTest.cpp index 2dd980f9..613243c5 100644 --- a/test/common/StringUtilTest.cpp +++ b/test/common/StringUtilTest.cpp @@ -3,12 +3,13 @@ #include +using cru::Index; using cru::k_invalid_code_point; TEST_CASE("StringUtil Utf8NextCodePoint", "[string]") { using cru::Utf8NextCodePoint; std::string_view text = "aπ你🤣!"; - gsl::index current = 0; + Index current = 0; REQUIRE(Utf8NextCodePoint(text.data(), text.size(), current, ¤t) == 0x0061); REQUIRE(Utf8NextCodePoint(text.data(), text.size(), current, ¤t) == @@ -21,13 +22,13 @@ TEST_CASE("StringUtil Utf8NextCodePoint", "[string]") { 0x0021); REQUIRE(Utf8NextCodePoint(text.data(), text.size(), current, ¤t) == k_invalid_code_point); - REQUIRE(current == static_cast(text.size())); + REQUIRE(current == static_cast(text.size())); } TEST_CASE("StringUtil Utf16NextCodePoint", "[string]") { using cru::Utf16NextCodePoint; std::u16string_view text = u"aπ你🤣!"; - gsl::index current = 0; + Index current = 0; REQUIRE(Utf16NextCodePoint(text.data(), text.size(), current, ¤t) == 0x0061); REQUIRE(Utf16NextCodePoint(text.data(), text.size(), current, ¤t) == @@ -40,13 +41,13 @@ TEST_CASE("StringUtil Utf16NextCodePoint", "[string]") { 0x0021); REQUIRE(Utf16NextCodePoint(text.data(), text.size(), current, ¤t) == k_invalid_code_point); - REQUIRE(current == static_cast(text.size())); + REQUIRE(current == static_cast(text.size())); } TEST_CASE("StringUtil Utf16PreviousCodePoint", "[string]") { using cru::Utf16PreviousCodePoint; std::u16string_view text = u"aπ你🤣!"; - gsl::index current = text.size(); + Index current = text.size(); REQUIRE(Utf16PreviousCodePoint(text.data(), text.size(), current, ¤t) == 0x0021); REQUIRE(Utf16PreviousCodePoint(text.data(), text.size(), current, ¤t) == -- cgit v1.2.3