mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
AK: Add StringView::ends_with function
This commit is contained in:
parent
27df4eb43d
commit
24bc674d94
3 changed files with 22 additions and 0 deletions
|
@ -42,6 +42,16 @@ TEST_CASE(starts_with)
|
|||
EXPECT(!test_string_view.starts_with("DEF"));
|
||||
}
|
||||
|
||||
TEST_CASE(ends_with)
|
||||
{
|
||||
String test_string = "ABCDEF";
|
||||
StringView test_string_view = test_string.view();
|
||||
EXPECT(test_string_view.ends_with("DEF"));
|
||||
EXPECT(test_string_view.ends_with("ABCDEF"));
|
||||
EXPECT(!test_string_view.ends_with("ABCDE"));
|
||||
EXPECT(!test_string_view.ends_with("ABCDEFG"));
|
||||
}
|
||||
|
||||
TEST_CASE(lines)
|
||||
{
|
||||
String test_string = "a\nb\r\nc\rd";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue