summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-08-16 10:28:26 -0400
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-08-18 09:47:09 +0430
commit325eabc770a92e3651e9c5fc74820622eae8ee48 (patch)
treea0911edffa6c22d27c1346f1ec561344d899354f /Tests
parentc4ee57653128d30ede233907ee1116e3713ec6ff (diff)
downloadserenity-325eabc770a92e3651e9c5fc74820622eae8ee48.zip
LibRegex: Ensure the GoBack operation decrements the code unit index
This was missed in commit 27d555bab0d84913599cea3c4a6b0a0ed2a15b66.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibRegex/Regex.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/LibRegex/Regex.cpp b/Tests/LibRegex/Regex.cpp
index 7b08d909e1..8cb3a87c9e 100644
--- a/Tests/LibRegex/Regex.cpp
+++ b/Tests/LibRegex/Regex.cpp
@@ -637,6 +637,8 @@ TEST_CASE(ECMA262_match)
{ "(a{4}){2}"sv, "aaaaaaaa"sv },
{ "(a{4}){2}"sv, "aaaaaabaa"sv, false },
{ "\\u{4}"sv, "uuuu" },
+ { "(?<=.{3})f"sv, "abcdef"sv, true, (ECMAScriptFlags)regex::AllFlags::Global },
+ { "(?<=.{3})f"sv, "abc😀ef"sv, true, (ECMAScriptFlags)regex::AllFlags::Global },
// ECMA262, B.1.4. Regular Expression Pattern extensions for browsers
{ "{"sv, "{"sv, true, ECMAScriptFlags::BrowserExtended },
{ "\\5"sv, "\5"sv, true, ECMAScriptFlags::BrowserExtended },
@@ -694,6 +696,8 @@ TEST_CASE(ECMA262_unicode_match)
{ "\\u{1f600}"sv, "😀"sv, true, ECMAScriptFlags::Unicode },
{ "\\ud83d\\ud83d"sv, "\xed\xa0\xbd\xed\xa0\xbd"sv, true },
{ "\\ud83d\\ud83d"sv, "\xed\xa0\xbd\xed\xa0\xbd"sv, true, ECMAScriptFlags::Unicode },
+ { "(?<=.{3})f"sv, "abcdef"sv, true, ECMAScriptFlags::Unicode },
+ { "(?<=.{3})f"sv, "abc😀ef"sv, true, ECMAScriptFlags::Unicode },
};
for (auto& test : tests) {