| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #library("utf32_tests"); | 6 #library("utf32_tests"); |
| 7 #import("dunit.dart"); | 7 #import("dunit.dart"); |
| 8 #import("../../string_encoding/unicode_core.dart"); | 8 #import("../../string_encoding/unicode_core.dart"); |
| 9 #import("../../string_encoding/utf32.dart"); | 9 #import("../../string_encoding/utf32.dart"); |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 TestSuite suite = new TestSuite(); | 12 TestSuite suite = new TestSuite(); |
| 13 suite.registerTestClass(new Utf32Tests()); | 13 suite.registerTestClass(new Utf32Tests()); |
| 14 suite.run(); | 14 suite.run(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 class Utf32Tests extends TestClass { | 17 class Utf32Tests extends TestClass { |
| 18 static final String testKoreanCharSubset = """ | 18 static const String testKoreanCharSubset = """ |
| 19 가각갂갃간갅갆갇갈갉갊갋갌갍갎갏감갑값갓갔강갖갗갘같갚갛 | 19 가각갂갃간갅갆갇갈갉갊갋갌갍갎갏감갑값갓갔강갖갗갘같갚갛 |
| 20 개객갞갟갠갡갢갣갤갥갦갧갨갩갪갫갬갭갮갯갰갱갲갳갴갵갶갷 | 20 개객갞갟갠갡갢갣갤갥갦갧갨갩갪갫갬갭갮갯갰갱갲갳갴갵갶갷 |
| 21 갸갹갺갻갼갽갾갿걀걁걂걃걄걅걆걇걈걉걊걋걌걍걎걏걐걑걒걓"""; | 21 갸갹갺갻갼갽갾갿걀걁걂걃걄걅걆걇걈걉걊걋걌걍걎걏걐걑걒걓"""; |
| 22 static final String testHanTwice = "二"; | 22 static const String testHanTwice = "二"; |
| 23 | 23 |
| 24 static final List<int> testKoreanCharSubsetUtf32beBom = const<int>[ | 24 static const List<int> testKoreanCharSubsetUtf32beBom = const<int>[ |
| 25 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xac, 0x00, | 25 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xac, 0x00, |
| 26 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xac, 0x02, | 26 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xac, 0x02, |
| 27 0x00, 0x00, 0xac, 0x03, 0x00, 0x00, 0xac, 0x04, | 27 0x00, 0x00, 0xac, 0x03, 0x00, 0x00, 0xac, 0x04, |
| 28 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0xac, 0x06, | 28 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0xac, 0x06, |
| 29 0x00, 0x00, 0xac, 0x07, 0x00, 0x00, 0xac, 0x08, | 29 0x00, 0x00, 0xac, 0x07, 0x00, 0x00, 0xac, 0x08, |
| 30 0x00, 0x00, 0xac, 0x09, 0x00, 0x00, 0xac, 0x0a, | 30 0x00, 0x00, 0xac, 0x09, 0x00, 0x00, 0xac, 0x0a, |
| 31 0x00, 0x00, 0xac, 0x0b, 0x00, 0x00, 0xac, 0x0c, | 31 0x00, 0x00, 0xac, 0x0b, 0x00, 0x00, 0xac, 0x0c, |
| 32 0x00, 0x00, 0xac, 0x0d, 0x00, 0x00, 0xac, 0x0e, | 32 0x00, 0x00, 0xac, 0x0d, 0x00, 0x00, 0xac, 0x0e, |
| 33 0x00, 0x00, 0xac, 0x0f, 0x00, 0x00, 0xac, 0x10, | 33 0x00, 0x00, 0xac, 0x0f, 0x00, 0x00, 0xac, 0x10, |
| 34 0x00, 0x00, 0xac, 0x11, 0x00, 0x00, 0xac, 0x12, | 34 0x00, 0x00, 0xac, 0x11, 0x00, 0x00, 0xac, 0x12, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 60 0x00, 0x00, 0xac, 0x43, 0x00, 0x00, 0xac, 0x44, | 60 0x00, 0x00, 0xac, 0x43, 0x00, 0x00, 0xac, 0x44, |
| 61 0x00, 0x00, 0xac, 0x45, 0x00, 0x00, 0xac, 0x46, | 61 0x00, 0x00, 0xac, 0x45, 0x00, 0x00, 0xac, 0x46, |
| 62 0x00, 0x00, 0xac, 0x47, 0x00, 0x00, 0xac, 0x48, | 62 0x00, 0x00, 0xac, 0x47, 0x00, 0x00, 0xac, 0x48, |
| 63 0x00, 0x00, 0xac, 0x49, 0x00, 0x00, 0xac, 0x4a, | 63 0x00, 0x00, 0xac, 0x49, 0x00, 0x00, 0xac, 0x4a, |
| 64 0x00, 0x00, 0xac, 0x4b, 0x00, 0x00, 0xac, 0x4c, | 64 0x00, 0x00, 0xac, 0x4b, 0x00, 0x00, 0xac, 0x4c, |
| 65 0x00, 0x00, 0xac, 0x4d, 0x00, 0x00, 0xac, 0x4e, | 65 0x00, 0x00, 0xac, 0x4d, 0x00, 0x00, 0xac, 0x4e, |
| 66 0x00, 0x00, 0xac, 0x4f, 0x00, 0x00, 0xac, 0x50, | 66 0x00, 0x00, 0xac, 0x4f, 0x00, 0x00, 0xac, 0x50, |
| 67 0x00, 0x00, 0xac, 0x51, 0x00, 0x00, 0xac, 0x52, | 67 0x00, 0x00, 0xac, 0x51, 0x00, 0x00, 0xac, 0x52, |
| 68 0x00, 0x00, 0xac, 0x53]; | 68 0x00, 0x00, 0xac, 0x53]; |
| 69 | 69 |
| 70 static final List<int> testKoreanCharSubsetUtf32le = const<int>[ | 70 static const List<int> testKoreanCharSubsetUtf32le = const<int>[ |
| 71 0x00, 0xac, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, | 71 0x00, 0xac, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, |
| 72 0x02, 0xac, 0x00, 0x00, 0x03, 0xac, 0x00, 0x00, | 72 0x02, 0xac, 0x00, 0x00, 0x03, 0xac, 0x00, 0x00, |
| 73 0x04, 0xac, 0x00, 0x00, 0x05, 0xac, 0x00, 0x00, | 73 0x04, 0xac, 0x00, 0x00, 0x05, 0xac, 0x00, 0x00, |
| 74 0x06, 0xac, 0x00, 0x00, 0x07, 0xac, 0x00, 0x00, | 74 0x06, 0xac, 0x00, 0x00, 0x07, 0xac, 0x00, 0x00, |
| 75 0x08, 0xac, 0x00, 0x00, 0x09, 0xac, 0x00, 0x00, | 75 0x08, 0xac, 0x00, 0x00, 0x09, 0xac, 0x00, 0x00, |
| 76 0x0a, 0xac, 0x00, 0x00, 0x0b, 0xac, 0x00, 0x00, | 76 0x0a, 0xac, 0x00, 0x00, 0x0b, 0xac, 0x00, 0x00, |
| 77 0x0c, 0xac, 0x00, 0x00, 0x0d, 0xac, 0x00, 0x00, | 77 0x0c, 0xac, 0x00, 0x00, 0x0d, 0xac, 0x00, 0x00, |
| 78 0x0e, 0xac, 0x00, 0x00, 0x0f, 0xac, 0x00, 0x00, | 78 0x0e, 0xac, 0x00, 0x00, 0x0f, 0xac, 0x00, 0x00, |
| 79 0x10, 0xac, 0x00, 0x00, 0x11, 0xac, 0x00, 0x00, | 79 0x10, 0xac, 0x00, 0x00, 0x11, 0xac, 0x00, 0x00, |
| 80 0x12, 0xac, 0x00, 0x00, 0x13, 0xac, 0x00, 0x00, | 80 0x12, 0xac, 0x00, 0x00, 0x13, 0xac, 0x00, 0x00, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // specify types | 179 // specify types |
| 180 Expect.equals(44032, (new List<int> | 180 Expect.equals(44032, (new List<int> |
| 181 .from(decodeUtf32beAsIterable(testKoreanCharSubsetUtf32beBom)))[0]); | 181 .from(decodeUtf32beAsIterable(testKoreanCharSubsetUtf32beBom)))[0]); |
| 182 Expect.equals(44032, (new List<int> | 182 Expect.equals(44032, (new List<int> |
| 183 .from(decodeUtf32leAsIterable(testKoreanCharSubsetUtf32le)))[0]); | 183 .from(decodeUtf32leAsIterable(testKoreanCharSubsetUtf32le)))[0]); |
| 184 Expect.equals(UNICODE_BOM, (new List<int> | 184 Expect.equals(UNICODE_BOM, (new List<int> |
| 185 .from(decodeUtf32beAsIterable(testKoreanCharSubsetUtf32beBom, | 185 .from(decodeUtf32beAsIterable(testKoreanCharSubsetUtf32beBom, |
| 186 stripBom: false)))[0]); | 186 stripBom: false)))[0]); |
| 187 } | 187 } |
| 188 } | 188 } |
| OLD | NEW |