summaryrefslogtreecommitdiff
path: root/AK/Tests/TestStringView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AK/Tests/TestStringView.cpp')
-rw-r--r--AK/Tests/TestStringView.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/AK/Tests/TestStringView.cpp b/AK/Tests/TestStringView.cpp
index 87d35263a3..add8726a1b 100644
--- a/AK/Tests/TestStringView.cpp
+++ b/AK/Tests/TestStringView.cpp
@@ -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)