summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js')
-rw-r--r--js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js118
1 files changed, 118 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js b/js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js
new file mode 100644
index 000000000..543f50b17
--- /dev/null
+++ b/js/src/jit-test/tests/regexp_parse/CharacterClass_CharacterClassEscape.js
@@ -0,0 +1,118 @@
+if (typeof parseRegExp === 'undefined')
+ quit();
+
+load(libdir + "regexp_parse.js");
+
+test("[\\d]", all_flags,
+ CharacterClass([["0", "9"]]));
+
+test("[\\D]", no_unicode_flags,
+ CharacterClass([
+ ["\u0000", "/"],
+ [":", "\uFFFF"]
+ ]));
+test("[\\D]", unicode_flags,
+ AllSurrogateAndCharacterClass([
+ ["\u0000", "/"],
+ [":", "\uD7FF"],
+ ["\uE000", "\uFFFF"]
+ ]));
+
+test("[\\s]", all_flags,
+ CharacterClass([
+ ["\t", "\r"],
+ [" ", " "],
+ ["\u00A0", "\u00A0"],
+ ["\u1680", "\u1680"],
+ ["\u180E", "\u180E"],
+ ["\u2000", "\u200A"],
+ ["\u2028", "\u2029"],
+ ["\u202F", "\u202F"],
+ ["\u205F", "\u205F"],
+ ["\u3000", "\u3000"],
+ ["\uFEFF", "\uFEFF"]
+ ]));
+test("[\\S]", no_unicode_flags,
+ CharacterClass([
+ ["\u0000", "\u0008"],
+ ["\u000E", "\u001F"],
+ ["!", "\u009F"],
+ ["\u00A1", "\u167F"],
+ ["\u1681", "\u180D"],
+ ["\u180F", "\u1FFF"],
+ ["\u200B", "\u2027"],
+ ["\u202A", "\u202E"],
+ ["\u2030", "\u205E"],
+ ["\u2060", "\u2FFF"],
+ ["\u3001", "\uFEFE"],
+ ["\uFF00", "\uFFFF"]
+ ]));
+test("[\\S]", unicode_flags,
+ AllSurrogateAndCharacterClass([
+ ["\u0000", "\u0008"],
+ ["\u000E", "\u001F"],
+ ["!", "\u009F"],
+ ["\u00A1", "\u167F"],
+ ["\u1681", "\u180D"],
+ ["\u180F", "\u1FFF"],
+ ["\u200B", "\u2027"],
+ ["\u202A", "\u202E"],
+ ["\u2030", "\u205E"],
+ ["\u2060", "\u2FFF"],
+ ["\u3001", "\uD7FF"],
+ ["\uE000", "\uFEFE"],
+ ["\uFF00", "\uFFFF"]
+ ]));
+
+test("[\\w]", no_unicode_flags,
+ CharacterClass([
+ ["0", "9"],
+ ["A", "Z"],
+ ["_", "_"],
+ ["a", "z"]
+ ]));
+test("[\\w]", ["u", "mu"],
+ CharacterClass([
+ ["0", "9"],
+ ["A", "Z"],
+ ["_", "_"],
+ ["a", "z"]
+ ]));
+test("[\\w]", ["iu", "imu"],
+ CharacterClass([
+ ["0", "9"],
+ ["A", "Z"],
+ ["_", "_"],
+ ["a", "z"],
+ ["\u017F", "\u017F"],
+ ["\u212A", "\u212A"]
+ ]));
+
+test("[\\W]", no_unicode_flags,
+ CharacterClass([
+ ["\u0000", "/"],
+ [":", "@"],
+ ["[", "^"],
+ ["`", "`"],
+ ["{", "\uFFFF"]
+ ]));
+test("[\\W]", ["u", "mu"],
+ AllSurrogateAndCharacterClass([
+ ["\u0000", "/"],
+ [":", "@"],
+ ["[", "^"],
+ ["`", "`"],
+ ["{", "\uD7FF"],
+ ["\uE000", "\uFFFF"]
+ ]));
+test("[\\W]", ["iu", "imu"],
+ AllSurrogateAndCharacterClass([
+ ["\u0000", "/"],
+ [":", "@"],
+ ["[", "^"],
+ ["`", "`"],
+ ["{", "\u017E"],
+ ["\u0180", "\u2129"],
+ ["\u212B", "\uD7FF"],
+ ["\uE000", "\uFFFF"]
+ ]));