summaryrefslogtreecommitdiff
path: root/Tests/LibRegex/Regex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/LibRegex/Regex.cpp')
-rw-r--r--Tests/LibRegex/Regex.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/LibRegex/Regex.cpp b/Tests/LibRegex/Regex.cpp
index 50420c504a..41c7d1c355 100644
--- a/Tests/LibRegex/Regex.cpp
+++ b/Tests/LibRegex/Regex.cpp
@@ -1034,3 +1034,14 @@ TEST_CASE(single_match_flag)
EXPECT_EQ(result.matches.first().view.to_string(), "A"sv);
}
}
+
+TEST_CASE(inversion_state_in_char_class)
+{
+ // #13755, /[\S\s]/.exec("hello") should be [ "h" ], not null.
+ Regex<ECMA262> re("[\\S\\s]", ECMAScriptFlags::Global | (ECMAScriptFlags)regex::AllFlags::SingleMatch);
+
+ auto result = re.match("hello");
+ EXPECT_EQ(result.success, true);
+ EXPECT_EQ(result.matches.size(), 1u);
+ EXPECT_EQ(result.matches.first().view.to_string(), "h"sv);
+}