OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 // Dart test for reading escape sequences in string literals | |
5 | |
6 import "package:expect/expect.dart"; | |
7 | |
8 class CharEscapeTest { | |
9 static testMain() { | |
10 var x00 = "\x00"; | |
11 var u0000 = "\u0000"; | |
12 var v0 = "\u{0}"; | |
13 var v00 = "\u{00}"; | |
14 var v000 = "\u{000}"; | |
15 var v0000 = "\u{0000}"; | |
16 var v00000 = "\u{00000}"; | |
17 var v000000 = "\u{000000}"; | |
18 Expect.equals(1, x00.length); | |
19 Expect.equals(1, u0000.length); | |
20 Expect.equals(1, v0.length); | |
21 Expect.equals(1, v00.length); | |
22 Expect.equals(1, v000.length); | |
23 Expect.equals(1, v0000.length); | |
24 Expect.equals(1, v00000.length); | |
25 Expect.equals(1, v000000.length); | |
26 Expect.equals(0, x00.codeUnitAt(0)); | |
27 Expect.equals(0, u0000.codeUnitAt(0)); | |
28 Expect.equals(0, v0.codeUnitAt(0)); | |
29 Expect.equals(0, v00.codeUnitAt(0)); | |
30 Expect.equals(0, v000.codeUnitAt(0)); | |
31 Expect.equals(0, v0000.codeUnitAt(0)); | |
32 Expect.equals(0, v00000.codeUnitAt(0)); | |
33 Expect.equals(0, v000000.codeUnitAt(0)); | |
34 Expect.equals("\x00", new String.fromCharCodes([0])); | |
35 Expect.equals("\u0000", new String.fromCharCodes([0])); | |
36 Expect.equals("\u{0}", new String.fromCharCodes([0])); | |
37 Expect.equals("\u{00}", new String.fromCharCodes([0])); | |
38 Expect.equals("\u{000}", new String.fromCharCodes([0])); | |
39 Expect.equals("\u{0000}", new String.fromCharCodes([0])); | |
40 Expect.equals("\u{00000}", new String.fromCharCodes([0])); | |
41 Expect.equals("\u{000000}", new String.fromCharCodes([0])); | |
42 | |
43 var x01 = "\x01"; | |
44 var u0001 = "\u0001"; | |
45 var v1 = "\u{1}"; | |
46 var v01 = "\u{01}"; | |
47 var v001 = "\u{001}"; | |
48 var v0001 = "\u{0001}"; | |
49 var v00001 = "\u{00001}"; | |
50 var v000001 = "\u{000001}"; | |
51 Expect.equals(1, x01.length); | |
52 Expect.equals(1, u0001.length); | |
53 Expect.equals(1, v1.length); | |
54 Expect.equals(1, v01.length); | |
55 Expect.equals(1, v001.length); | |
56 Expect.equals(1, v0001.length); | |
57 Expect.equals(1, v00001.length); | |
58 Expect.equals(1, v000001.length); | |
59 Expect.equals(1, x01.codeUnitAt(0)); | |
60 Expect.equals(1, u0001.codeUnitAt(0)); | |
61 Expect.equals(1, v1.codeUnitAt(0)); | |
62 Expect.equals(1, v01.codeUnitAt(0)); | |
63 Expect.equals(1, v001.codeUnitAt(0)); | |
64 Expect.equals(1, v0001.codeUnitAt(0)); | |
65 Expect.equals(1, v00001.codeUnitAt(0)); | |
66 Expect.equals(1, v000001.codeUnitAt(0)); | |
67 Expect.equals("\x01", new String.fromCharCodes([1])); | |
68 Expect.equals("\u0001", new String.fromCharCodes([1])); | |
69 Expect.equals("\u{1}", new String.fromCharCodes([1])); | |
70 Expect.equals("\u{01}", new String.fromCharCodes([1])); | |
71 Expect.equals("\u{001}", new String.fromCharCodes([1])); | |
72 Expect.equals("\u{0001}", new String.fromCharCodes([1])); | |
73 Expect.equals("\u{00001}", new String.fromCharCodes([1])); | |
74 Expect.equals("\u{000001}", new String.fromCharCodes([1])); | |
75 | |
76 var x55 = "\x55"; | |
77 var u0055 = "\u0055"; | |
78 var v55 = "\u{55}"; | |
79 var v055 = "\u{055}"; | |
80 var v0055 = "\u{0055}"; | |
81 var v00055 = "\u{00055}"; | |
82 var v000055 = "\u{000055}"; | |
83 Expect.equals(1, x55.length); | |
84 Expect.equals(1, u0055.length); | |
85 Expect.equals(1, v55.length); | |
86 Expect.equals(1, v055.length); | |
87 Expect.equals(1, v0055.length); | |
88 Expect.equals(1, v00055.length); | |
89 Expect.equals(1, v000055.length); | |
90 Expect.equals(0x55, x55.codeUnitAt(0)); | |
91 Expect.equals(0x55, u0055.codeUnitAt(0)); | |
92 Expect.equals(0x55, v55.codeUnitAt(0)); | |
93 Expect.equals(0x55, v055.codeUnitAt(0)); | |
94 Expect.equals(0x55, v0055.codeUnitAt(0)); | |
95 Expect.equals(0x55, v00055.codeUnitAt(0)); | |
96 Expect.equals(0x55, v000055.codeUnitAt(0)); | |
97 Expect.equals("\x55", new String.fromCharCodes([0x55])); | |
98 Expect.equals("\u0055", new String.fromCharCodes([0x55])); | |
99 Expect.equals("\u{55}", new String.fromCharCodes([0x55])); | |
100 Expect.equals("\u{055}", new String.fromCharCodes([0x55])); | |
101 Expect.equals("\u{0055}", new String.fromCharCodes([0x55])); | |
102 Expect.equals("\u{00055}", new String.fromCharCodes([0x55])); | |
103 Expect.equals("\u{000055}", new String.fromCharCodes([0x55])); | |
104 | |
105 var x7F = "\x7F"; | |
106 var u007F = "\u007F"; | |
107 var v7F = "\u{7F}"; | |
108 var v07F = "\u{07F}"; | |
109 var v007F = "\u{007F}"; | |
110 var v0007F = "\u{0007F}"; | |
111 var v00007F = "\u{00007F}"; | |
112 Expect.equals(1, x7F.length); | |
113 Expect.equals(1, u007F.length); | |
114 Expect.equals(1, v7F.length); | |
115 Expect.equals(1, v07F.length); | |
116 Expect.equals(1, v007F.length); | |
117 Expect.equals(1, v0007F.length); | |
118 Expect.equals(1, v00007F.length); | |
119 Expect.equals(0x7F, x7F.codeUnitAt(0)); | |
120 Expect.equals(0x7F, u007F.codeUnitAt(0)); | |
121 Expect.equals(0x7F, v7F.codeUnitAt(0)); | |
122 Expect.equals(0x7F, v07F.codeUnitAt(0)); | |
123 Expect.equals(0x7F, v007F.codeUnitAt(0)); | |
124 Expect.equals(0x7F, v0007F.codeUnitAt(0)); | |
125 Expect.equals(0x7F, v00007F.codeUnitAt(0)); | |
126 Expect.equals("\x7F", new String.fromCharCodes([0x7F])); | |
127 Expect.equals("\u007F", new String.fromCharCodes([0x7F])); | |
128 Expect.equals("\u{7F}", new String.fromCharCodes([0x7F])); | |
129 Expect.equals("\u{07F}", new String.fromCharCodes([0x7F])); | |
130 Expect.equals("\u{007F}", new String.fromCharCodes([0x7F])); | |
131 Expect.equals("\u{0007F}", new String.fromCharCodes([0x7F])); | |
132 Expect.equals("\u{00007F}", new String.fromCharCodes([0x7F])); | |
133 | |
134 var x80 = "\x80"; | |
135 var u0080 = "\u0080"; | |
136 var v80 = "\u{80}"; | |
137 var v080 = "\u{080}"; | |
138 var v0080 = "\u{0080}"; | |
139 var v00080 = "\u{00080}"; | |
140 var v000080 = "\u{000080}"; | |
141 Expect.equals(1, x80.length); | |
142 Expect.equals(1, u0080.length); | |
143 Expect.equals(1, v80.length); | |
144 Expect.equals(1, v080.length); | |
145 Expect.equals(1, v0080.length); | |
146 Expect.equals(1, v00080.length); | |
147 Expect.equals(1, v000080.length); | |
148 Expect.equals(0x80, x80.codeUnitAt(0)); | |
149 Expect.equals(0x80, u0080.codeUnitAt(0)); | |
150 Expect.equals(0x80, v80.codeUnitAt(0)); | |
151 Expect.equals(0x80, v080.codeUnitAt(0)); | |
152 Expect.equals(0x80, v0080.codeUnitAt(0)); | |
153 Expect.equals(0x80, v00080.codeUnitAt(0)); | |
154 Expect.equals(0x80, v000080.codeUnitAt(0)); | |
155 Expect.equals("\x80", new String.fromCharCodes([0x80])); | |
156 Expect.equals("\u0080", new String.fromCharCodes([0x80])); | |
157 Expect.equals("\u{80}", new String.fromCharCodes([0x80])); | |
158 Expect.equals("\u{080}", new String.fromCharCodes([0x80])); | |
159 Expect.equals("\u{0080}", new String.fromCharCodes([0x80])); | |
160 Expect.equals("\u{00080}", new String.fromCharCodes([0x80])); | |
161 Expect.equals("\u{000080}", new String.fromCharCodes([0x80])); | |
162 | |
163 var xAA = "\xAA"; | |
164 var u00AA = "\u00AA"; | |
165 var vAA = "\u{AA}"; | |
166 var v0AA = "\u{0AA}"; | |
167 var v00AA = "\u{00AA}"; | |
168 var v000AA = "\u{000AA}"; | |
169 var v0000AA = "\u{0000AA}"; | |
170 Expect.equals(1, xAA.length); | |
171 Expect.equals(1, u00AA.length); | |
172 Expect.equals(1, vAA.length); | |
173 Expect.equals(1, v0AA.length); | |
174 Expect.equals(1, v00AA.length); | |
175 Expect.equals(1, v000AA.length); | |
176 Expect.equals(1, v0000AA.length); | |
177 Expect.equals(0xAA, xAA.codeUnitAt(0)); | |
178 Expect.equals(0xAA, u00AA.codeUnitAt(0)); | |
179 Expect.equals(0xAA, vAA.codeUnitAt(0)); | |
180 Expect.equals(0xAA, v0AA.codeUnitAt(0)); | |
181 Expect.equals(0xAA, v00AA.codeUnitAt(0)); | |
182 Expect.equals(0xAA, v000AA.codeUnitAt(0)); | |
183 Expect.equals(0xAA, v0000AA.codeUnitAt(0)); | |
184 Expect.equals("\xAA", new String.fromCharCodes([0xAA])); | |
185 Expect.equals("\u00AA", new String.fromCharCodes([0xAA])); | |
186 Expect.equals("\u{AA}", new String.fromCharCodes([0xAA])); | |
187 Expect.equals("\u{0AA}", new String.fromCharCodes([0xAA])); | |
188 Expect.equals("\u{00AA}", new String.fromCharCodes([0xAA])); | |
189 Expect.equals("\u{000AA}", new String.fromCharCodes([0xAA])); | |
190 Expect.equals("\u{0000AA}", new String.fromCharCodes([0xAA])); | |
191 | |
192 var xFE = "\xFE"; | |
193 var u00FE = "\u00FE"; | |
194 var vFE = "\u{FE}"; | |
195 var v0FE = "\u{0FE}"; | |
196 var v00FE = "\u{00FE}"; | |
197 var v000FE = "\u{000FE}"; | |
198 var v0000FE = "\u{0000FE}"; | |
199 Expect.equals(1, xFE.length); | |
200 Expect.equals(1, u00FE.length); | |
201 Expect.equals(1, vFE.length); | |
202 Expect.equals(1, v0FE.length); | |
203 Expect.equals(1, v00FE.length); | |
204 Expect.equals(1, v000FE.length); | |
205 Expect.equals(1, v0000FE.length); | |
206 Expect.equals(0xFE, xFE.codeUnitAt(0)); | |
207 Expect.equals(0xFE, u00FE.codeUnitAt(0)); | |
208 Expect.equals(0xFE, vFE.codeUnitAt(0)); | |
209 Expect.equals(0xFE, v0FE.codeUnitAt(0)); | |
210 Expect.equals(0xFE, v00FE.codeUnitAt(0)); | |
211 Expect.equals(0xFE, v000FE.codeUnitAt(0)); | |
212 Expect.equals(0xFE, v0000FE.codeUnitAt(0)); | |
213 Expect.equals("\xFE", new String.fromCharCodes([0xFE])); | |
214 Expect.equals("\u00FE", new String.fromCharCodes([0xFE])); | |
215 Expect.equals("\u{FE}", new String.fromCharCodes([0xFE])); | |
216 Expect.equals("\u{0FE}", new String.fromCharCodes([0xFE])); | |
217 Expect.equals("\u{00FE}", new String.fromCharCodes([0xFE])); | |
218 Expect.equals("\u{000FE}", new String.fromCharCodes([0xFE])); | |
219 Expect.equals("\u{0000FE}", new String.fromCharCodes([0xFE])); | |
220 | |
221 var xFF = "\xFF"; | |
222 var u00FF = "\u00FF"; | |
223 var vFF = "\u{FF}"; | |
224 var v0FF = "\u{0FF}"; | |
225 var v00FF = "\u{00FF}"; | |
226 var v000FF = "\u{000FF}"; | |
227 var v0000FF = "\u{0000FF}"; | |
228 Expect.equals(1, xFF.length); | |
229 Expect.equals(1, u00FF.length); | |
230 Expect.equals(1, vFF.length); | |
231 Expect.equals(1, v0FF.length); | |
232 Expect.equals(1, v00FF.length); | |
233 Expect.equals(1, v000FF.length); | |
234 Expect.equals(1, v0000FF.length); | |
235 Expect.equals(0xFF, xFF.codeUnitAt(0)); | |
236 Expect.equals(0xFF, u00FF.codeUnitAt(0)); | |
237 Expect.equals(0xFF, vFF.codeUnitAt(0)); | |
238 Expect.equals(0xFF, v0FF.codeUnitAt(0)); | |
239 Expect.equals(0xFF, v00FF.codeUnitAt(0)); | |
240 Expect.equals(0xFF, v000FF.codeUnitAt(0)); | |
241 Expect.equals(0xFF, v0000FF.codeUnitAt(0)); | |
242 Expect.equals("\xFF", new String.fromCharCodes([0xFF])); | |
243 Expect.equals("\u00FF", new String.fromCharCodes([0xFF])); | |
244 Expect.equals("\u{FF}", new String.fromCharCodes([0xFF])); | |
245 Expect.equals("\u{0FF}", new String.fromCharCodes([0xFF])); | |
246 Expect.equals("\u{00FF}", new String.fromCharCodes([0xFF])); | |
247 Expect.equals("\u{000FF}", new String.fromCharCodes([0xFF])); | |
248 Expect.equals("\u{0000FF}", new String.fromCharCodes([0xFF])); | |
249 | |
250 var u1000 = "\u1000"; | |
251 var v1000 = "\u{1000}"; | |
252 var v01000 = "\u{01000}"; | |
253 var v001000 = "\u{001000}"; | |
254 Expect.equals(1, u1000.length); | |
255 Expect.equals(1, v1000.length); | |
256 Expect.equals(1, v01000.length); | |
257 Expect.equals(1, v001000.length); | |
258 Expect.equals(0x1000, u1000.codeUnitAt(0)); | |
259 Expect.equals(0x1000, v1000.codeUnitAt(0)); | |
260 Expect.equals(0x1000, v01000.codeUnitAt(0)); | |
261 Expect.equals(0x1000, v001000.codeUnitAt(0)); | |
262 Expect.equals("\u1000", new String.fromCharCodes([0x1000])); | |
263 Expect.equals("\u{1000}", new String.fromCharCodes([0x1000])); | |
264 Expect.equals("\u{01000}", new String.fromCharCodes([0x1000])); | |
265 Expect.equals("\u{001000}", new String.fromCharCodes([0x1000])); | |
266 | |
267 var u5555 = "\u5555"; | |
268 var v5555 = "\u{5555}"; | |
269 var v05555 = "\u{05555}"; | |
270 var v005555 = "\u{005555}"; | |
271 Expect.equals(1, u5555.length); | |
272 Expect.equals(1, v5555.length); | |
273 Expect.equals(1, v05555.length); | |
274 Expect.equals(1, v005555.length); | |
275 Expect.equals(0x5555, u5555.codeUnitAt(0)); | |
276 Expect.equals(0x5555, v5555.codeUnitAt(0)); | |
277 Expect.equals(0x5555, v05555.codeUnitAt(0)); | |
278 Expect.equals(0x5555, v005555.codeUnitAt(0)); | |
279 Expect.equals("\u5555", new String.fromCharCodes([0x5555])); | |
280 Expect.equals("\u{5555}", new String.fromCharCodes([0x5555])); | |
281 Expect.equals("\u{05555}", new String.fromCharCodes([0x5555])); | |
282 Expect.equals("\u{005555}", new String.fromCharCodes([0x5555])); | |
283 | |
284 var u7FFF = "\u7FFF"; | |
285 var v7FFF = "\u{7FFF}"; | |
286 var v07FFF = "\u{07FFF}"; | |
287 var v007FFF = "\u{007FFF}"; | |
288 Expect.equals(1, u7FFF.length); | |
289 Expect.equals(1, v7FFF.length); | |
290 Expect.equals(1, v07FFF.length); | |
291 Expect.equals(1, v007FFF.length); | |
292 Expect.equals(0x7FFF, u7FFF.codeUnitAt(0)); | |
293 Expect.equals(0x7FFF, v7FFF.codeUnitAt(0)); | |
294 Expect.equals(0x7FFF, v07FFF.codeUnitAt(0)); | |
295 Expect.equals(0x7FFF, v007FFF.codeUnitAt(0)); | |
296 Expect.equals("\u7FFF", new String.fromCharCodes([0x7FFF])); | |
297 Expect.equals("\u{7FFF}", new String.fromCharCodes([0x7FFF])); | |
298 Expect.equals("\u{07FFF}", new String.fromCharCodes([0x7FFF])); | |
299 Expect.equals("\u{007FFF}", new String.fromCharCodes([0x7FFF])); | |
300 | |
301 var u8000 = "\u8000"; | |
302 var v8000 = "\u{8000}"; | |
303 var v08000 = "\u{08000}"; | |
304 var v008000 = "\u{008000}"; | |
305 Expect.equals(1, u8000.length); | |
306 Expect.equals(1, v8000.length); | |
307 Expect.equals(1, v08000.length); | |
308 Expect.equals(1, v008000.length); | |
309 Expect.equals(0x8000, u8000.codeUnitAt(0)); | |
310 Expect.equals(0x8000, v8000.codeUnitAt(0)); | |
311 Expect.equals(0x8000, v08000.codeUnitAt(0)); | |
312 Expect.equals(0x8000, v008000.codeUnitAt(0)); | |
313 Expect.equals("\u8000", new String.fromCharCodes([0x8000])); | |
314 Expect.equals("\u{8000}", new String.fromCharCodes([0x8000])); | |
315 Expect.equals("\u{08000}", new String.fromCharCodes([0x8000])); | |
316 Expect.equals("\u{008000}", new String.fromCharCodes([0x8000])); | |
317 | |
318 var uAAAA = "\uAAAA"; | |
319 var vAAAA = "\u{AAAA}"; | |
320 var v0AAAA = "\u{0AAAA}"; | |
321 var v00AAAA = "\u{00AAAA}"; | |
322 Expect.equals(1, uAAAA.length); | |
323 Expect.equals(1, vAAAA.length); | |
324 Expect.equals(1, v0AAAA.length); | |
325 Expect.equals(1, v00AAAA.length); | |
326 Expect.equals(0xAAAA, uAAAA.codeUnitAt(0)); | |
327 Expect.equals(0xAAAA, vAAAA.codeUnitAt(0)); | |
328 Expect.equals(0xAAAA, v0AAAA.codeUnitAt(0)); | |
329 Expect.equals(0xAAAA, v00AAAA.codeUnitAt(0)); | |
330 Expect.equals("\uAAAA", new String.fromCharCodes([0xAAAA])); | |
331 Expect.equals("\u{AAAA}", new String.fromCharCodes([0xAAAA])); | |
332 Expect.equals("\u{0AAAA}", new String.fromCharCodes([0xAAAA])); | |
333 Expect.equals("\u{00AAAA}", new String.fromCharCodes([0xAAAA])); | |
334 | |
335 var uFFFE = "\uFFFE"; | |
336 var vFFFE = "\u{FFFE}"; | |
337 var v0FFFE = "\u{0FFFE}"; | |
338 var v00FFFE = "\u{00FFFE}"; | |
339 Expect.equals(1, uFFFE.length); | |
340 Expect.equals(1, vFFFE.length); | |
341 Expect.equals(1, v0FFFE.length); | |
342 Expect.equals(1, v00FFFE.length); | |
343 Expect.equals(0xFFFE, uFFFE.codeUnitAt(0)); | |
344 Expect.equals(0xFFFE, vFFFE.codeUnitAt(0)); | |
345 Expect.equals(0xFFFE, v0FFFE.codeUnitAt(0)); | |
346 Expect.equals(0xFFFE, v00FFFE.codeUnitAt(0)); | |
347 Expect.equals("\uFFFE", new String.fromCharCodes([0xFFFE])); | |
348 Expect.equals("\u{FFFE}", new String.fromCharCodes([0xFFFE])); | |
349 Expect.equals("\u{0FFFE}", new String.fromCharCodes([0xFFFE])); | |
350 Expect.equals("\u{00FFFE}", new String.fromCharCodes([0xFFFE])); | |
351 | |
352 var uFFFF = "\uFFFF"; | |
353 var vFFFF = "\u{FFFF}"; | |
354 var v0FFFF = "\u{0FFFF}"; | |
355 var v00FFFF = "\u{00FFFF}"; | |
356 Expect.equals(1, uFFFF.length); | |
357 Expect.equals(1, vFFFF.length); | |
358 Expect.equals(1, v0FFFF.length); | |
359 Expect.equals(1, v00FFFF.length); | |
360 Expect.equals(0xFFFF, uFFFF.codeUnitAt(0)); | |
361 Expect.equals(0xFFFF, vFFFF.codeUnitAt(0)); | |
362 Expect.equals(0xFFFF, v0FFFF.codeUnitAt(0)); | |
363 Expect.equals(0xFFFF, v00FFFF.codeUnitAt(0)); | |
364 Expect.equals("\uFFFF", new String.fromCharCodes([0xFFFF])); | |
365 Expect.equals("\u{FFFF}", new String.fromCharCodes([0xFFFF])); | |
366 Expect.equals("\u{0FFFF}", new String.fromCharCodes([0xFFFF])); | |
367 Expect.equals("\u{00FFFF}", new String.fromCharCodes([0xFFFF])); | |
368 | |
369 var v10000 = "\u{10000}"; | |
370 var v010000 = "\u{010000}"; | |
371 Expect.equals(2, v10000.length); | |
372 Expect.equals(2, v010000.length); | |
373 Expect.equals("\u{10000}", new String.fromCharCodes([0x10000])); | |
374 Expect.equals("\u{010000}", new String.fromCharCodes([0x10000])); | |
375 | |
376 var v1FFFF = "\u{1FFFF}"; | |
377 var v01FFFF = "\u{01FFFF}"; | |
378 Expect.equals(2, v1FFFF.length); | |
379 Expect.equals(2, v01FFFF.length); | |
380 Expect.equals("\u{1FFFF}", new String.fromCharCodes([0x1FFFF])); | |
381 Expect.equals("\u{01FFFF}", new String.fromCharCodes([0x1FFFF])); | |
382 | |
383 var v105555 = "\u{105555}"; | |
384 Expect.equals(2, v105555.length); | |
385 Expect.equals("\u{105555}", new String.fromCharCodes([0x105555])); | |
386 | |
387 var v10FFFF = "\u{10FFFF}"; | |
388 Expect.equals(2, v10FFFF.length); | |
389 Expect.equals("\u{10FFFF}", new String.fromCharCodes([0x10FFFF])); | |
390 | |
391 var bs = "\b"; | |
392 Expect.isTrue(bs != "b"); | |
393 Expect.equals(1, bs.length); | |
394 Expect.equals(0x08, bs.codeUnitAt(0)); | |
395 Expect.equals(bs, new String.fromCharCodes([0x08])); | |
396 Expect.equals("\x08", bs); | |
397 Expect.equals("\u0008", bs); | |
398 Expect.equals("\u{8}", bs); | |
399 Expect.equals("\u{08}", bs); | |
400 Expect.equals("\u{008}", bs); | |
401 Expect.equals("\u{0008}", bs); | |
402 Expect.equals("\u{00008}", bs); | |
403 Expect.equals("\u{000008}", bs); | |
404 | |
405 var ht = "\t"; | |
406 Expect.isTrue(ht != "t"); | |
407 Expect.equals(1, ht.length); | |
408 Expect.equals(0x09, ht.codeUnitAt(0)); | |
409 Expect.equals(ht, new String.fromCharCodes([0x09])); | |
410 Expect.equals("\x09", ht); | |
411 Expect.equals("\u0009", ht); | |
412 Expect.equals("\u{9}", ht); | |
413 Expect.equals("\u{09}", ht); | |
414 Expect.equals("\u{009}", ht); | |
415 Expect.equals("\u{0009}", ht); | |
416 Expect.equals("\u{00009}", ht); | |
417 Expect.equals("\u{000009}", ht); | |
418 | |
419 var lf = "\n"; | |
420 Expect.isTrue(lf != "n"); | |
421 Expect.equals(1, lf.length); | |
422 Expect.equals(0x0A, lf.codeUnitAt(0)); | |
423 Expect.equals(lf, new String.fromCharCodes([0x0A])); | |
424 Expect.equals("\x0A", lf); | |
425 Expect.equals("\u000A", lf); | |
426 Expect.equals("\u{A}", lf); | |
427 Expect.equals("\u{0A}", lf); | |
428 Expect.equals("\u{00A}", lf); | |
429 Expect.equals("\u{000A}", lf); | |
430 Expect.equals("\u{0000A}", lf); | |
431 Expect.equals("\u{00000A}", lf); | |
432 | |
433 var vt = "\v"; | |
434 Expect.isTrue(vt != "v"); | |
435 Expect.equals(1, vt.length); | |
436 Expect.equals(0x0B, vt.codeUnitAt(0)); | |
437 Expect.equals(vt, new String.fromCharCodes([0x0B])); | |
438 Expect.equals("\x0B", vt); | |
439 Expect.equals("\u000B", vt); | |
440 Expect.equals("\u{B}", vt); | |
441 Expect.equals("\u{0B}", vt); | |
442 Expect.equals("\u{00B}", vt); | |
443 Expect.equals("\u{000B}", vt); | |
444 Expect.equals("\u{0000B}", vt); | |
445 Expect.equals("\u{00000B}", vt); | |
446 | |
447 var ff = "\f"; | |
448 Expect.isTrue(ff != "f"); | |
449 Expect.equals(1, ff.length); | |
450 Expect.equals(0x0C, ff.codeUnitAt(0)); | |
451 Expect.equals(ff, new String.fromCharCodes([0x0C])); | |
452 Expect.equals("\x0C", ff); | |
453 Expect.equals("\u000C", ff); | |
454 Expect.equals("\u{C}", ff); | |
455 Expect.equals("\u{0C}", ff); | |
456 Expect.equals("\u{00C}", ff); | |
457 Expect.equals("\u{000C}", ff); | |
458 Expect.equals("\u{0000C}", ff); | |
459 Expect.equals("\u{00000C}", ff); | |
460 | |
461 var cr = "\r"; | |
462 Expect.isTrue(cr != "r"); | |
463 Expect.equals(1, cr.length); | |
464 Expect.equals(0x0D, cr.codeUnitAt(0)); | |
465 Expect.equals(cr, new String.fromCharCodes([0x0D])); | |
466 Expect.equals("\x0D", cr); | |
467 Expect.equals("\u000D", cr); | |
468 Expect.equals("\u{D}", cr); | |
469 Expect.equals("\u{0D}", cr); | |
470 Expect.equals("\u{00D}", cr); | |
471 Expect.equals("\u{000D}", cr); | |
472 Expect.equals("\u{0000D}", cr); | |
473 Expect.equals("\u{00000D}", cr); | |
474 | |
475 Expect.equals("\a", "a"); | |
476 // \b U+0006 BS | |
477 Expect.equals("\c", "c"); | |
478 Expect.equals("\d", "d"); | |
479 Expect.equals("\e", "e"); | |
480 // \f U+000C FF | |
481 Expect.equals("\g", "g"); | |
482 Expect.equals("\h", "h"); | |
483 Expect.equals("\i", "i"); | |
484 Expect.equals("\j", "j"); | |
485 Expect.equals("\k", "k"); | |
486 Expect.equals("\l", "l"); | |
487 Expect.equals("\m", "m"); | |
488 // \n U+000A LF | |
489 Expect.equals("\o", "o"); | |
490 Expect.equals("\p", "p"); | |
491 Expect.equals("\q", "q"); | |
492 // \r U+000D CR | |
493 Expect.equals("\s", "s"); | |
494 // \t U+0009 HT | |
495 // \u code point escape | |
496 // \v U+000B VT | |
497 Expect.equals("\w", "w"); | |
498 // \x code point escape | |
499 Expect.equals("\y", "y"); | |
500 Expect.equals("\z", "z"); | |
501 | |
502 Expect.equals("\A", "A"); | |
503 Expect.equals("\B", "B"); | |
504 Expect.equals("\C", "C"); | |
505 Expect.equals("\D", "D"); | |
506 Expect.equals("\E", "E"); | |
507 Expect.equals("\F", "F"); | |
508 Expect.equals("\G", "G"); | |
509 Expect.equals("\H", "H"); | |
510 Expect.equals("\I", "I"); | |
511 Expect.equals("\J", "J"); | |
512 Expect.equals("\K", "K"); | |
513 Expect.equals("\L", "L"); | |
514 Expect.equals("\M", "M"); | |
515 Expect.equals("\N", "N"); | |
516 Expect.equals("\O", "O"); | |
517 Expect.equals("\P", "P"); | |
518 Expect.equals("\Q", "Q"); | |
519 Expect.equals("\R", "R"); | |
520 Expect.equals("\S", "S"); | |
521 Expect.equals("\T", "T"); | |
522 Expect.equals("\U", "U"); | |
523 Expect.equals("\V", "V"); | |
524 Expect.equals("\W", "W"); | |
525 Expect.equals("\X", "X"); | |
526 Expect.equals("\Y", "Y"); | |
527 Expect.equals("\Z", "Z"); | |
528 } | |
529 } | |
530 | |
531 main() { | |
532 CharEscapeTest.testMain(); | |
533 } | |
OLD | NEW |