OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #import("dart:io"); | 5 #import("dart:io"); |
6 #import("dart:isolate"); | 6 #import("dart:isolate"); |
7 | 7 |
8 void testUtf8() { | 8 void testUtf8() { |
9 List<int> data = [0x01, | 9 List<int> data = [0x01, |
10 0x7f, | 10 0x7f, |
(...skipping 11 matching lines...) Expand all Loading... |
22 Expect.equals(8, s.length); | 22 Expect.equals(8, s.length); |
23 Expect.equals(new String.fromCharCodes([0x01]), s[0]); | 23 Expect.equals(new String.fromCharCodes([0x01]), s[0]); |
24 Expect.equals(new String.fromCharCodes([0x7f]), s[1]); | 24 Expect.equals(new String.fromCharCodes([0x7f]), s[1]); |
25 Expect.equals(new String.fromCharCodes([0x80]), s[2]); | 25 Expect.equals(new String.fromCharCodes([0x80]), s[2]); |
26 Expect.equals(new String.fromCharCodes([0x7ff]), s[3]); | 26 Expect.equals(new String.fromCharCodes([0x7ff]), s[3]); |
27 Expect.equals(new String.fromCharCodes([0x800]), s[4]); | 27 Expect.equals(new String.fromCharCodes([0x800]), s[4]); |
28 Expect.equals(new String.fromCharCodes([0xffff]), s[5]); | 28 Expect.equals(new String.fromCharCodes([0xffff]), s[5]); |
29 Expect.equals(new String.fromCharCodes([0xffff]), s[5]); | 29 Expect.equals(new String.fromCharCodes([0xffff]), s[5]); |
30 | 30 |
31 // Surrogate pair for U+1D11E. | 31 // Surrogate pair for U+1D11E. |
32 Expect.equals(new String.fromCharCodes([0xd834]), s[6]); | 32 Expect.equals(new String.fromCodeUnits([0xd834, 0xdd1e]), |
33 Expect.equals(new String.fromCharCodes([0xdd1e]), s[7]); | 33 s.substring(6, 8)); |
34 } | 34 } |
35 stream.onData = stringData; | 35 stream.onData = stringData; |
36 } | 36 } |
37 | 37 |
38 void testLatin1() { | 38 void testLatin1() { |
39 List<int> data = [0x01, | 39 List<int> data = [0x01, |
40 0x7f, | 40 0x7f, |
41 0x44, 0x61, 0x72, 0x74, | 41 0x44, 0x61, 0x72, 0x74, |
42 0x80, | 42 0x80, |
43 0xff]; | 43 0xff]; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 testUtf8(); | 326 testUtf8(); |
327 testLatin1(); | 327 testLatin1(); |
328 testAscii(); | 328 testAscii(); |
329 testReadLine1(); | 329 testReadLine1(); |
330 testReadLine2(); | 330 testReadLine2(); |
331 testReadChunks(); | 331 testReadChunks(); |
332 testReadMixed(); | 332 testReadMixed(); |
333 testErrorHandler(); | 333 testErrorHandler(); |
334 testEncodingErrorWithHandler(); | 334 testEncodingErrorWithHandler(); |
335 } | 335 } |
OLD | NEW |