mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibRegex: Fix greedy/reluctant modifiers in PosixExtendedParser
Also fixes the issue with assertions causing early termination when they fail.
This commit is contained in:
parent
45e5661296
commit
92ea9ed4a5
Notes:
sideshowbarker
2024-07-19 01:14:53 +09:00
Author: https://github.com/alimpfard
Commit: 92ea9ed4a5
Pull-request: https://github.com/SerenityOS/serenity/pull/4103
Reviewed-by: https://github.com/linusg ✅
5 changed files with 42 additions and 26 deletions
|
@ -334,6 +334,16 @@ TEST_CASE(match_all_character_class)
|
|||
EXPECT(&result.matches.at(0).view.characters_without_null_termination()[0] != &str.view().characters_without_null_termination()[1]);
|
||||
}
|
||||
|
||||
TEST_CASE(match_character_class_with_assertion)
|
||||
{
|
||||
Regex<PosixExtended> re("[[:alpha:]]+$");
|
||||
String str = "abcdef";
|
||||
RegexResult result = match(str, re);
|
||||
|
||||
EXPECT_EQ(result.success, true);
|
||||
EXPECT_EQ(result.count, 1u);
|
||||
}
|
||||
|
||||
TEST_CASE(example_for_git_commit)
|
||||
{
|
||||
Regex<PosixExtended> re("^.*$");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue