mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibRegex: Make FailForks fail all forks up to the last save point
This makes negative lookarounds with more than one fork behave correctly. Fixes #11350.
This commit is contained in:
parent
105d558922
commit
1a35e27490
Notes:
sideshowbarker
2024-07-17 22:11:15 +09:00
Author: https://github.com/alimpfard
Commit: 1a35e27490
Pull-request: https://github.com/SerenityOS/serenity/pull/11422
Issue: https://github.com/SerenityOS/serenity/issues/11350
4 changed files with 30 additions and 15 deletions
|
@ -973,3 +973,14 @@ TEST_CASE(posix_basic_dollar_is_literal)
|
|||
EXPECT_EQ(re.match("123abc$", PosixFlags::Global).success, true);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(negative_lookahead)
|
||||
{
|
||||
{
|
||||
// Negative lookahead with more than 2 forks difference between lookahead init and finish.
|
||||
Regex<ECMA262> re(":(?!\\^\\)|1)", ECMAScriptFlags::Global);
|
||||
EXPECT_EQ(re.match(":^)").success, false);
|
||||
EXPECT_EQ(re.match(":1").success, false);
|
||||
EXPECT_EQ(re.match(":foobar").success, true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue