diff options
author | crupest <crupest@outlook.com> | 2024-02-08 15:12:29 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-02-08 15:12:29 +0800 |
commit | f3af6c7e5b46f4209a4981e5d7be217368f40b15 (patch) | |
tree | e932747ad91a718abb667a6170b21f1521a04d1e /test/common/StringUtilTest.cpp | |
parent | bfe23251a54b036abef9241ba0994c9e51db25b2 (diff) | |
download | cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.tar.gz cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.tar.bz2 cru-f3af6c7e5b46f4209a4981e5d7be217368f40b15.zip |
Get rid of GSL.
Diffstat (limited to 'test/common/StringUtilTest.cpp')
-rw-r--r-- | test/common/StringUtilTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 <catch2/catch_test_macros.hpp> +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<gsl::index>(text.size())); + REQUIRE(current == static_cast<Index>(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<gsl::index>(text.size())); + REQUIRE(current == static_cast<Index>(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) == |