mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
AK: Don’t drop lines between \r and \n in StringView::lines() (#7662)
StringView::lines() supports line-separators “\n”, “\r”, and “\r\n”. The method will drop an entire line if it is surrounded by “\r” and “\n” separators on the left and right sides respectively.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
1828607606
commit
5a6f0ef1bc
@@ -77,7 +77,7 @@ TEST_CASE(ends_with)
|
||||
|
||||
TEST_CASE(lines)
|
||||
{
|
||||
String test_string = "a\nb\r\nc\rd";
|
||||
String test_string = "a\rb\nc\r\nd";
|
||||
StringView test_string_view = test_string.view();
|
||||
Vector<StringView> test_string_vector = test_string_view.lines();
|
||||
EXPECT_EQ(test_string_vector.size(), 4u);
|
||||
|
||||
Reference in New Issue
Block a user