TestStringView: Add test for starts_with

This commit is contained in:
MinusGix 2019-09-12 08:05:47 -05:00 committed by Andreas Kling
parent 05f641a5a9
commit a574e1ab84
Notes: sideshowbarker 2024-07-19 12:08:34 +09:00

View file

@ -33,4 +33,13 @@ TEST_CASE(compare_views)
EXPECT_EQ(view1, "foo");
}
TEST_CASE(starts_with)
{
String test_string = "ABCDEF";
StringView test_string_view = test_string.view();
EXPECT(test_string_view.starts_with("AB"));
EXPECT(test_string_view.starts_with("ABCDEF"));
EXPECT(!test_string_view.starts_with("DEF"));
}
TEST_MAIN(StringView)