TEST(StringViewTests, stdStringConstructor) { std::string string("ABCD"); const StringView view = string; ASSERT_EQ(string.data(), view.getData()); ASSERT_EQ(string.size(), view.getSize()); }
TEST(StringViewTests, arrayConstructor) { const char data[] = "ABCD"; const StringView view = data; ASSERT_EQ(data, view.getData()); ASSERT_EQ(4, view.getSize()); }