| 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 utf8_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, |
| 11 0xc5, 0xbe, 0xc3, 0xa5, 0xc5, 0xa3, 0xc3, 0xae, 0xe1, | 11 0xc5, 0xbe, 0xc3, 0xa5, 0xc5, 0xa3, 0xc3, 0xae, 0xe1, |
| 12 0xbb, 0x9d, 0xc3, 0xb1]; | 12 0xbb, 0x9d, 0xc3, 0xb1]; |
| 13 const INTER_STRING = "Îñţérñåţîöñåļîžåţîờñ"; | 13 const INTER_STRING = "Îñţérñåţîöñåļîžåţîờñ"; |
| 14 | 14 |
| 15 // Blueberry porridge in Danish: "blåbærgrød". | 15 // Blueberry porridge in Danish: "blåbærgrød". |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const _TEST_PAIRS = const [ | 48 const _TEST_PAIRS = const [ |
| 49 const [ const [], "" ], | 49 const [ const [], "" ], |
| 50 const [ INTER_BYTES, INTER_STRING ], | 50 const [ INTER_BYTES, INTER_STRING ], |
| 51 const [ BLUEBERRY_BYTES, BLUEBERRY_STRING ], | 51 const [ BLUEBERRY_BYTES, BLUEBERRY_STRING ], |
| 52 const [ SIVA_BYTES1, SIVA_STRING1 ], | 52 const [ SIVA_BYTES1, SIVA_STRING1 ], |
| 53 const [ SIVA_BYTES2, SIVA_STRING2 ], | 53 const [ SIVA_BYTES2, SIVA_STRING2 ], |
| 54 const [ BEE_BYTES, BEE_STRING ], | 54 const [ BEE_BYTES, BEE_STRING ], |
| 55 const [ DIGIT_BYTES, DIGIT_STRING ], | 55 const [ DIGIT_BYTES, DIGIT_STRING ], |
| 56 const [ ASCII_BYTES, ASCII_STRING ]]; | 56 const [ ASCII_BYTES, ASCII_STRING ]]; |
| 57 | 57 |
| 58 _expandTestPairs() { | 58 List<List> _expandTestPairs() { |
| 59 assert(2 == BEE_STRING.length); | 59 assert(2 == BEE_STRING.length); |
| 60 var tests = []; | 60 var tests = []; |
| 61 tests.addAll(_TEST_PAIRS); | 61 tests.addAll(_TEST_PAIRS); |
| 62 tests.addAll(_TEST_PAIRS.expand((test) { | 62 tests.addAll(_TEST_PAIRS.expand((test) { |
| 63 var bytes = test[0]; | 63 var bytes = test[0]; |
| 64 var string = test[1]; | 64 var string = test[1]; |
| 65 var longBytes = []; | 65 var longBytes = []; |
| 66 var longString = ""; | 66 var longString = ""; |
| 67 for (int i = 0; i < 100; i++) { | 67 for (int i = 0; i < 100; i++) { |
| 68 longBytes.addAll(bytes); | 68 longBytes.addAll(bytes); |
| 69 longString += string; | 69 longString += string; |
| 70 } | 70 } |
| 71 return [test, [longBytes, longString]]; | 71 return [test, [longBytes, longString]]; |
| 72 })); | 72 })); |
| 73 return tests; | 73 return tests; |
| 74 } | 74 } |
| 75 | 75 |
| 76 final List UNICODE_TESTS = _expandTestPairs(); | 76 final List UNICODE_TESTS = _expandTestPairs(); |
| OLD | NEW |