From 87071200872c2450c947047350132aee493033c1 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 2 Jan 2025 15:11:51 -0600 Subject: Get basic CSV parser operating. --- test/test_string.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/test_string.cpp') 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"; -- cgit v1.2.3