OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library unicode_tests; | 5 library unicode_tests; |
6 | 6 |
7 // Google favorite: "Îñţérñåţîöñåļîžåţîờñ". | 7 // Google favorite: "Îñţérñåţîöñåļîžåţîờñ". |
8 const INTER_BYTES = const [0xc3, 0x8e, 0xc3, 0xb1, 0xc5, 0xa3, 0xc3, 0xa9, 0x72, | 8 const INTER_BYTES = const [0xc3, 0x8e, 0xc3, 0xb1, 0xc5, 0xa3, 0xc3, 0xa9, 0x72, |
9 0xc3, 0xb1, 0xc3, 0xa5, 0xc5, 0xa3, 0xc3, 0xae, 0xc3, | 9 0xc3, 0xb1, 0xc3, 0xa5, 0xc5, 0xa3, 0xc3, 0xae, 0xc3, |
10 0xb6, 0xc3, 0xb1, 0xc3, 0xa5, 0xc4, 0xbc, 0xc3, 0xae, | 10 0xb6, 0xc3, 0xb1, 0xc3, 0xa5, 0xc4, 0xbc, 0xc3, 0xae, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const [ SMALLEST_3_UTF8_UNIT_BYTES, SMALLEST_3_UTF8_UNIT_STRING ], | 81 const [ SMALLEST_3_UTF8_UNIT_BYTES, SMALLEST_3_UTF8_UNIT_STRING ], |
82 const [ BIGGEST_3_UTF8_UNIT_BYTES, BIGGEST_3_UTF8_UNIT_STRING ], | 82 const [ BIGGEST_3_UTF8_UNIT_BYTES, BIGGEST_3_UTF8_UNIT_STRING ], |
83 const [ SMALLEST_4_UTF8_UNIT_BYTES, SMALLEST_4_UTF8_UNIT_STRING ], | 83 const [ SMALLEST_4_UTF8_UNIT_BYTES, SMALLEST_4_UTF8_UNIT_STRING ], |
84 const [ BIGGEST_4_UTF8_UNIT_BYTES, BIGGEST_4_UTF8_UNIT_STRING ], | 84 const [ BIGGEST_4_UTF8_UNIT_BYTES, BIGGEST_4_UTF8_UNIT_STRING ], |
85 ]; | 85 ]; |
86 | 86 |
87 List<List> _expandTestPairs() { | 87 List<List> _expandTestPairs() { |
88 assert(2 == BEE_STRING.length); | 88 assert(2 == BEE_STRING.length); |
89 var tests = []; | 89 var tests = []; |
90 tests.addAll(_TEST_PAIRS); | 90 tests.addAll(_TEST_PAIRS); |
91 tests.addAll(_TEST_PAIRS.expand((test) { | 91 tests.addAll(_TEST_PAIRS.map((test) { |
92 var bytes = test[0]; | 92 var bytes = test[0]; |
93 var string = test[1]; | 93 var string = test[1]; |
94 var longBytes = []; | 94 var longBytes = []; |
95 var longString = ""; | 95 var longString = ""; |
96 for (int i = 0; i < 100; i++) { | 96 for (int i = 0; i < 100; i++) { |
97 longBytes.addAll(bytes); | 97 longBytes.addAll(bytes); |
98 longString += string; | 98 longString += string; |
99 } | 99 } |
100 return [test, [longBytes, longString]]; | 100 return [longBytes, longString]; |
101 })); | 101 })); |
102 return tests; | 102 return tests; |
103 } | 103 } |
104 | 104 |
105 final List UNICODE_TESTS = _expandTestPairs(); | 105 final List UNICODE_TESTS = _expandTestPairs(); |
OLD | NEW |