mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
AK: Add a method to check if a UTF-16 string contains any code point
This commit is contained in:
parent
8ada4b7fdc
commit
21d7d236e6
Notes:
github-actions[bot]
2025-07-28 16:33:06 +00:00
Author: https://github.com/trflynn89
Commit: 21d7d236e6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5627
Reviewed-by: https://github.com/gmta ✅
3 changed files with 33 additions and 0 deletions
|
|
@ -564,6 +564,28 @@ TEST_CASE(contains)
|
|||
EXPECT(u"ab😀"sv.contains(u"😀"sv));
|
||||
}
|
||||
|
||||
TEST_CASE(contains_any_of)
|
||||
{
|
||||
EXPECT(!u""sv.contains_any_of({}));
|
||||
EXPECT(!u"a"sv.contains_any_of({}));
|
||||
|
||||
EXPECT(u"a"sv.contains_any_of({ { 'a' } }));
|
||||
EXPECT(u"a"sv.contains_any_of({ { 'a', 'b' } }));
|
||||
EXPECT(u"b"sv.contains_any_of({ { 'a', 'b' } }));
|
||||
EXPECT(!u"a"sv.contains_any_of({ { 'b' } }));
|
||||
EXPECT(!u"b"sv.contains_any_of({ { 'a' } }));
|
||||
|
||||
EXPECT(u"ab"sv.contains_any_of({ { 'a' } }));
|
||||
EXPECT(u"ab"sv.contains_any_of({ { 'b' } }));
|
||||
EXPECT(u"ab"sv.contains_any_of({ { 'a', 'b' } }));
|
||||
EXPECT(!u"ab"sv.contains_any_of({ { 'c' } }));
|
||||
|
||||
EXPECT(!u"😀"sv.contains_any_of({ { 0xd83d } }));
|
||||
EXPECT(!u"😀"sv.contains_any_of({ { 0xde00 } }));
|
||||
EXPECT(u"😀"sv.contains_any_of({ { 0x1f600 } }));
|
||||
EXPECT(u"ab😀"sv.contains_any_of({ { 0x1f600 } }));
|
||||
}
|
||||
|
||||
TEST_CASE(count)
|
||||
{
|
||||
EXPECT_EQ(u""sv.count({}), 0uz);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue