summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/regexp_parse/Atom_CharacterClassEscape.js
blob: 62bb736f8e980d4af5e01df70a70f36ac0486b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
if (typeof parseRegExp === 'undefined')
    quit();

load(libdir + "regexp_parse.js");

test_mix("\\d", all_flags,
         CharacterClass([["0", "9"]]));

test_mix("\\D", no_unicode_flags,
         CharacterClass([
             ["\u0000", "/"],
             [":", "\uFFFF"]
         ]));
test_mix("\\D", unicode_flags,
         AllSurrogateAndCharacterClass([
             ["\u0000", "/"],
             [":", "\uD7FF"],
             ["\uE000", "\uFFFF"]
         ]));

test_mix("\\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_mix("\\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_mix("\\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_mix("\\w", no_unicode_flags,
         CharacterClass([
             ["0", "9"],
             ["A", "Z"],
             ["_", "_"],
             ["a", "z"]
         ]));
test_mix("\\w", ["u", "mu"],
         CharacterClass([
             ["0", "9"],
             ["A", "Z"],
             ["_", "_"],
             ["a", "z"]
         ]));
test_mix("\\w", ["iu", "imu"],
         CharacterClass([
             ["0", "9"],
             ["A", "Z"],
             ["_", "_"],
             ["a", "z"],
             ["\u017F", "\u017F"],
             ["\u212A", "\u212A"]
         ]));

test_mix("\\W", no_unicode_flags,
         CharacterClass([
             ["\u0000", "/"],
             [":", "@"],
             ["[", "^"],
             ["`", "`"],
             ["{", "\uFFFF"]
         ]));
test_mix("\\W", ["u", "mu"],
         AllSurrogateAndCharacterClass([
             ["\u0000", "/"],
             [":", "@"],
             ["[", "^"],
             ["`", "`"],
             ["{", "\uD7FF"],
             ["\uE000", "\uFFFF"]
         ]));
test_mix("\\W", ["iu", "imu"],
         AllSurrogateAndCharacterClass([
             ["\u0000", "/"],
             [":", "@"],
             ["[", "^"],
             ["`", "`"],
             ["{", "\u017E"],
             ["\u0180", "\u2129"],
             ["\u212B", "\uD7FF"],
             ["\uE000", "\uFFFF"]
         ]));