Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tests/language/src/CharEscapeTest.dart

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

Powered by Google App Engine
This is Rietveld 408576698