1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:27:35 +00:00

AK+Everywhere: Stop including Vector.h from StringView.h

Preparation for using Error.h from Vector.h. This required moving some
things out of line.
This commit is contained in:
Andreas Kling 2021-11-10 11:05:21 +01:00
parent e52f987020
commit 5f7d008791
27 changed files with 88 additions and 51 deletions

View file

@ -7,6 +7,7 @@
#include <LibTest/TestCase.h>
#include <AK/String.h>
#include <AK/Vector.h>
TEST_CASE(construct_empty)
{
@ -157,7 +158,7 @@ TEST_CASE(split_view)
EXPECT_EQ(test_string_view.split_view("xx", true), Vector<StringView>({ "a", "bc", "d", "" }));
test_string_view = "ax_b_cxd";
auto predicate = [](char ch) { return ch == 'x' || ch == '_'; };
Function<bool(char)> predicate = [](char ch) { return ch == 'x' || ch == '_'; };
EXPECT_EQ(test_string_view.split_view_if(predicate), Vector<StringView>({ "a", "b", "c", "d" }));
EXPECT_EQ(test_string_view.split_view_if(predicate, true), Vector<StringView>({ "a", "", "b", "c", "d" }));
EXPECT_EQ(test_string_view.split_view_if(predicate), Vector<StringView>({ "a", "b", "c", "d" }));