diff options
Diffstat (limited to 'libs/kstd/kstd/string.test.cpp')
| -rw-r--r-- | libs/kstd/kstd/string.test.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libs/kstd/kstd/string.test.cpp b/libs/kstd/kstd/string.test.cpp index 9755676..b81cd3a 100644 --- a/libs/kstd/kstd/string.test.cpp +++ b/libs/kstd/kstd/string.test.cpp @@ -22,7 +22,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string is empty") { - REQUIRE(str.view() == std::string_view{}); + REQUIRE(str == std::string_view{}); } } } @@ -43,7 +43,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same characters as the view") { - REQUIRE(str.view() == view); + REQUIRE(str == view); } } } @@ -64,7 +64,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same characters as the C-style string") { - REQUIRE(str.view() == c_str); + REQUIRE(str == c_str); } } } @@ -85,7 +85,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same character as the given character") { - REQUIRE(str.view() == std::string_view{&ch, 1}); + REQUIRE(str == std::string_view{&ch, 1}); } } } @@ -100,7 +100,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the new string contains the same characters as the original") { - REQUIRE(str.view() == other.view()); + REQUIRE(static_cast<std::string_view>(str) == static_cast<std::string_view>(other)); } } @@ -113,7 +113,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same characters as the assigned string") { - REQUIRE(str.view() == other.view()); + REQUIRE(static_cast<std::string_view>(str) == static_cast<std::string_view>(other)); } } } @@ -129,7 +129,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same characters as the assigned view") { - REQUIRE(str.view() == view); + REQUIRE(str == view); } } } @@ -145,7 +145,7 @@ SCENARIO("String initialization and construction", "[string]") THEN("the string contains the same characters as the assigned C-style string") { - REQUIRE(str.view() == c_str); + REQUIRE(str == c_str); } } } @@ -164,7 +164,7 @@ SCENARIO("String concatenation", "[string]") THEN("the first string contains the characters of both strings concatenated") { - REQUIRE(str1.view() == "Blub Blub"); + REQUIRE(str1 == "Blub Blub"); } THEN("the size of the first string is the sum of the sizes of both strings") @@ -179,7 +179,7 @@ SCENARIO("String concatenation", "[string]") THEN("the first string contains the characters of both strings concatenated") { - REQUIRE(str1.view() == "Blub Blub"); + REQUIRE(str1 == "Blub Blub"); } THEN("the size of the first string is the sum of the sizes of both strings") @@ -194,7 +194,7 @@ SCENARIO("String concatenation", "[string]") THEN("the new string contains the characters of both strings concatenated") { - REQUIRE(str3.view() == "Blub Blub"); + REQUIRE(str3 == "Blub Blub"); } THEN("the size of the new string is the sum of the sizes of both strings") @@ -215,7 +215,7 @@ SCENARIO("String concatenation", "[string]") THEN("the string contains the characters of both the original string and the appended view concatenated") { - REQUIRE(str.view() == "Blub Blub"); + REQUIRE(str == "Blub Blub"); } THEN("the size of the string is the sum of the sizes of the original string and the appended view") @@ -236,7 +236,7 @@ SCENARIO("String concatenation", "[string]") THEN("the string contains the original characters followed by the appended character") { - REQUIRE(str.view() == "Blub!"); + REQUIRE(str == "Blub!"); } THEN("the size of the string is one more than the original size") @@ -251,7 +251,7 @@ SCENARIO("String concatenation", "[string]") THEN("the string contains the original characters followed by the appended character") { - REQUIRE(str.view() == "Blub!"); + REQUIRE(str == "Blub!"); } THEN("the size of the string is one more than the original size") @@ -276,8 +276,8 @@ SCENARIO("String conversion and comparison", "[string]") THEN("the string contains the decimal representation of the unsigned integer") { - REQUIRE(str1.view() == "12345"); - REQUIRE(str2.view() == "0"); + REQUIRE(str1 == "12345"); + REQUIRE(str2 == "0"); } } } @@ -335,7 +335,7 @@ SCENARIO("String clearing", "[string]") THEN("the string contains no characters") { - REQUIRE(str.view() == std::string_view{}); + REQUIRE(str == std::string_view{}); } } } @@ -351,7 +351,7 @@ SCENARIO("String iteration", "[string]") { kstd::string result; - for (auto ch : str.view()) + for (auto ch : static_cast<std::string_view>(str)) { result.push_back(ch); } @@ -396,14 +396,14 @@ SCENARIO("String iteration", "[string]") { kstd::string result; - for (auto ch : str.view()) + for (auto ch : static_cast<std::string_view>(str)) { result.push_back(ch); } THEN("the iterated characters are the same as the characters in the string") { - REQUIRE(result == str.view()); + REQUIRE(result == static_cast<std::string_view>(str)); } } @@ -429,7 +429,7 @@ SCENARIO("String iteration", "[string]") { kstd::string result; - for (auto ch : str.view()) + for (auto ch : static_cast<std::string_view>(str)) { result.push_back(ch); } @@ -438,7 +438,7 @@ SCENARIO("String iteration", "[string]") { REQUIRE(result.empty()); REQUIRE(result.size() == 0); - REQUIRE(result.view() == std::string_view{}); + REQUIRE(static_cast<std::string_view>(result) == std::string_view{}); } } } |
