diff options
Diffstat (limited to 'test/test_string.cpp')
-rw-r--r-- | test/test_string.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_string.cpp b/test/test_string.cpp index ba2df6c..39a24cb 100644 --- a/test/test_string.cpp +++ b/test/test_string.cpp @@ -39,6 +39,7 @@ TEST(FudString, BasicStringOps) ASSERT_FALSE(Ascii::valid(invalid[0])); const Array<utf8, 2> invalid2{0xFF, 0x00}; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) auto stringResult = String::makeFromCString(reinterpret_cast<const char*>(invalid2.data())); ASSERT_TRUE(stringResult.isOkay()); @@ -77,7 +78,9 @@ TEST(FudString, ViewFromCString) TEST(FudString, HeapAlloc) { + // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays) constexpr const char filenameLiteral[] = "Amazing Saga Volume 01/000.jpg"; + // NOLINTNEXTLINE auto filenameResult{String::makeFromCString(filenameLiteral)}; ASSERT_TRUE(filenameResult.isOkay()); auto filename{filenameResult.takeOkay()}; @@ -92,6 +95,18 @@ TEST(FudString, Reserve) ASSERT_TRUE(testString.utf8Valid()); } +TEST(FudString, Equality) +{ + StringView levo{u8"a"}; + StringView dextro{u8"a"}; + ASSERT_EQ(levo, dextro); + + levo = StringView{u8"z"}; + dextro = StringView{u8"z"}; + ASSERT_EQ(levo, dextro); + ASSERT_EQ(levo.length(), 1); +} + #if 0 TEST(FudString, FindSubstringCxx) { |