diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js b/js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js new file mode 100644 index 0000000000..d731fb6bbe --- /dev/null +++ b/js/src/tests/non262/RegExp/unicode-ignoreCase-escape.js @@ -0,0 +1,71 @@ +var BUGNUMBER = 1135377; +var summary = "Implement RegExp unicode flag -- ignoreCase flag with character class escape."; + +// \W doesn't match S or K from the change in +// https://github.com/tc39/ecma262/pull/525 +// (bug 1281739) + +print(BUGNUMBER + ": " + summary); + +// LATIN SMALL LETTER LONG S + +assertEqArray(/\w/iu.exec("S"), + ["S"]); +assertEqArray(/\w/iu.exec("s"), + ["s"]); +assertEqArray(/\w/iu.exec("\u017F"), + ["\u017F"]); + +assertEqArray(/[^\W]/iu.exec("S"), + ["S"]); +assertEqArray(/[^\W]/iu.exec("s"), + ["s"]); +assertEqArray(/[^\W]/iu.exec("\u017F"), + ["\u017F"]); + +assertEq(/\W/iu.exec("S"), + null); +assertEq(/\W/iu.exec("s"), + null); +assertEq(/\W/iu.exec("\u017F"), + null); + +assertEq(/[^\w]/iu.exec("S"), + null); +assertEq(/[^\w]/iu.exec("s"), + null); +assertEq(/[^\w]/iu.exec("\u017F"), + null); + +// KELVIN SIGN + +assertEqArray(/\w/iu.exec("k"), + ["k"]); +assertEqArray(/\w/iu.exec("k"), + ["k"]); +assertEqArray(/\w/iu.exec("\u212A"), + ["\u212A"]); + +assertEqArray(/[^\W]/iu.exec("k"), + ["k"]); +assertEqArray(/[^\W]/iu.exec("k"), + ["k"]); +assertEqArray(/[^\W]/iu.exec("\u212A"), + ["\u212A"]); + +assertEq(/\W/iu.exec("k"), + null); +assertEq(/\W/iu.exec("k"), + null); +assertEq(/\W/iu.exec("\u212A"), + null); + +assertEq(/[^\w]/iu.exec("k"), + null); +assertEq(/[^\w]/iu.exec("k"), + null); +assertEq(/[^\w]/iu.exec("\u212A"), + null); + +if (typeof reportCompare === "function") + reportCompare(true, true); |