summaryrefslogtreecommitdiff
path: root/AK/Tests
diff options
context:
space:
mode:
authorMinusGix <MinusGix@gmail.com>2019-09-12 08:05:47 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-09-13 09:22:30 +0200
commita574e1ab84634f593a660e99626f6f26cfebba34 (patch)
treeb6a0cee2325d23df54eaae185318ed5f30f66c36 /AK/Tests
parent05f641a5a9155855f922743148b3094d1ba6f21c (diff)
downloadserenity-a574e1ab84634f593a660e99626f6f26cfebba34.zip
TestStringView: Add test for starts_with
Diffstat (limited to 'AK/Tests')
-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)