Skip to content

Commit

Permalink
TestStringView: Add test for starts_with
Browse files Browse the repository at this point in the history
  • Loading branch information
MinusGix authored and awesomekling committed Sep 13, 2019
1 parent 05f641a commit a574e1a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions AK/Tests/TestStringView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a574e1a

Please sign in to comment.