diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-01-02 15:11:51 -0600 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-01-02 15:11:51 -0600 |
commit | 87071200872c2450c947047350132aee493033c1 (patch) | |
tree | 49109532d9bbd148b4e59043120037684093be33 /test/test_string.cpp | |
parent | 16379362c02a2472f00fac49cad62788547c9519 (diff) |
Get basic CSV parser operating.
Diffstat (limited to 'test/test_string.cpp')
-rw-r--r-- | test/test_string.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_string.cpp b/test/test_string.cpp index 6bcbd37..ba2df6c 100644 --- a/test/test_string.cpp +++ b/test/test_string.cpp @@ -56,11 +56,25 @@ TEST(FudString, BasicStringOps) StringView view1{}; ASSERT_FALSE(view1.utf8Valid()); + StringView view2{fudString}; ASSERT_TRUE(view2.utf8Valid()); ASSERT_TRUE(view2.nullTerminated()); } +TEST(FudString, ViewFromCString) +{ + StringView viewFromU8{u8"Test"}; + EXPECT_EQ(viewFromU8.length(), 4); + EXPECT_TRUE(viewFromU8.utf8Valid()); + EXPECT_TRUE(viewFromU8.nullTerminated()); + + StringView viewFromCString{StringView::makeFromCString("Test")}; + EXPECT_EQ(viewFromCString.length(), 4); + EXPECT_TRUE(viewFromCString.utf8Valid()); + EXPECT_TRUE(viewFromCString.nullTerminated()); +} + TEST(FudString, HeapAlloc) { constexpr const char filenameLiteral[] = "Amazing Saga Volume 01/000.jpg"; |