summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_5/RegExp/regress-429241.js
blob: a4b588feadb4fc4b819c01315b70c656fb9224a5 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

var gTestfile = 'regress-429241.js';
var BUGNUMBER = 429241;
var summary = '\\x or \\u followed by too few hex digits';
var r;

reportCompare(
  "x",
  (r = /[\x]+/.exec("\\x\0")) && r[0],
  "Section 1"
);

reportCompare(
  "xy",
  (r = /[\xy]+/.exec("\\xy\0")) && r[0],
  "Section 2"
);

reportCompare(
  "x0",
  (r = /[\x0]+/.exec("\\x0\0")) && r[0],
  "Section 3"
);

reportCompare(
  "x0y",
  (r = /[\x0y]+/.exec("\\x0y\0")) && r[0],
  "Section 4"
);

reportCompare(
  "\0",
  (r = /[\x00]+/.exec("\\x\0")) && r[0],
  "Section 5"
);

reportCompare(
  "0\0",
  (r = /[\x000]+/.exec("0\0")) && r[0],
  "Section 6"
);

reportCompare(
  "x",
  (r = /^\x$/.exec("x")) && r[0],
  "Section 7"
);

reportCompare(
  "xy",
  (r = /^\xy$/.exec("xy")) && r[0],
  "Section 8"
);

reportCompare(
  "x0",
  (r = /^\x0$/.exec("x0")) && r[0],
  "Section 9"
);

reportCompare(
  "x0y",
  (r = /^\x0y$/.exec("x0y")) && r[0],
  "Section 10"
);

reportCompare(
  null,
  /^\x00$/.exec("\0" + "0"),
  "Section 11"
);

reportCompare(
  "\0" + "0",
  (r = /^\x000$/.exec("\0" + "0")) && r[0],
  "Section 12"
);

reportCompare(
  "u",
  (r = /[\u]+/.exec("\\u\0")) && r[0],
  "Section 13"
);

reportCompare(
  "uy",
  (r = /[\uy]+/.exec("\\uy\0")) && r[0],
  "Section 14"
);

reportCompare(
  "u0",
  (r = /[\u0]+/.exec("\\u0\0")) && r[0],
  "Section 15"
);

reportCompare(
  "u0",
  (r = /[\u00]+/.exec("\\u0\0")) && r[0],
  "Section 16"
);

reportCompare(
  "u0",
  (r = /[\u000]+/.exec("\\u0\0")) && r[0],
  "Section 17"
);

reportCompare(
  "u0y",
  (r = /[\u0y]+/.exec("\\u0y\0")) && r[0],
  "Section 18"
);

reportCompare(
  "u0y",
  (r = /[\u00y]+/.exec("\\u0y\0")) && r[0],
  "Section 19"
);

reportCompare(
  "u0y",
  (r = /[\u000y]+/.exec("\\u0y\0")) && r[0],
  "Section 20"
);

reportCompare(
  "\0",
  (r = /[\u0000]+/.exec("\\u\0")) && r[0],
  "Section 21"
);

reportCompare(
  "0\0",
  (r = /[\u00000]+/.exec("0\0")) && r[0],
  "Section 22"
);

reportCompare(
  "u",
  (r = /^\u$/.exec("u")) && r[0],
  "Section 23"
);

reportCompare(
  "uy",
  (r = /^\uy$/.exec("uy")) && r[0],
  "Section 24"
);

reportCompare(
  "u0",
  (r = /^\u0$/.exec("u0")) && r[0],
  "Section 25"
);

reportCompare(
  "u00",
  (r = /^\u00$/.exec("u00")) && r[0],
  "Section 26"
);

reportCompare(
  "u000",
  (r = /^\u000$/.exec("u000")) && r[0],
  "Section 27"
);

reportCompare(
  "u0y",
  (r = /^\u0y$/.exec("u0y")) && r[0],
  "Section 28"
);

reportCompare(
  "u00y",
  (r = /^\u00y$/.exec("u00y")) && r[0],
  "Section 29"
);

reportCompare(
  "u000y",
  (r = /^\u000y$/.exec("u000y")) && r[0],
  "Section 30"
);

reportCompare(
  null,
  /^\u0000$/.exec("\0" + "0"),
  "Section 31"
);

reportCompare(
  "\0" + "0",
  (r = /^\u00000$/.exec("\0" + "0")) && r[0],
  "Section 32"
);