diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-07-07 23:27:51 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-07-09 01:00:44 +0000 |
commit | b85666b3d203bb39e75da8d582e428800f4cb26c (patch) | |
tree | e82cf410f23232828c2f0200832ed7dfccfd80f1 /Tests | |
parent | b7c50f7094577c61de9fdc35466b37f0f1927551 (diff) | |
download | serenity-b85666b3d203bb39e75da8d582e428800f4cb26c.zip |
LibRegex: Fix lookup table-based range checks in Compare
The lowercase version of a range is not required to be a valid range,
instead of casefolding the range and making it invalid, check twice with
both cases of the input character (which are the same as the input if
not insensitive).
This time includes an actual test :^)
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibRegex/Regex.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/LibRegex/Regex.cpp b/Tests/LibRegex/Regex.cpp index eac8709085..237b2f1efd 100644 --- a/Tests/LibRegex/Regex.cpp +++ b/Tests/LibRegex/Regex.cpp @@ -690,6 +690,7 @@ TEST_CASE(ECMA262_match) { "a|$"sv, "x"sv, true, (ECMAScriptFlags)regex::AllFlags::Global }, // #11940, Global (not the 'g' flag) regexps should attempt to match the zero-length end of the string too. { "foo\nbar"sv, "foo\nbar"sv, true }, // #12126, ECMA262 regexp should match literal newlines without the 's' flag. { "foo[^]bar"sv, "foo\nbar"sv, true }, // #12126, ECMA262 regexp should match newline with [^]. + { "^[_A-Z]+$"sv, "_aA"sv, true, ECMAScriptFlags::Insensitive } // Insensitive lookup table: characters in a range do not necessarily lie in the same range after being converted to lowercase. }; // clang-format on |