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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'unicode_tests.dart'; | 8 import 'unicode_tests.dart'; |
9 import '../../async_helper.dart'; | 9 import "package:async_helper/async_helper.dart"; |
10 | 10 |
11 void runTest(List<int> bytes, expected) { | 11 void runTest(List<int> bytes, expected) { |
12 var controller = new StreamController(); | 12 var controller = new StreamController(); |
13 asyncStart(); | 13 asyncStart(); |
14 UTF8.decodeStream(controller.stream).then((decoded) { | 14 UTF8.decodeStream(controller.stream).then((decoded) { |
15 Expect.equals(expected, decoded); | 15 Expect.equals(expected, decoded); |
16 asyncEnd(); | 16 asyncEnd(); |
17 }); | 17 }); |
18 int i = 0; | 18 int i = 0; |
19 while (i < bytes.length) { | 19 while (i < bytes.length) { |
(...skipping 10 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 main() { | 33 main() { |
34 for (var test in UNICODE_TESTS) { | 34 for (var test in UNICODE_TESTS) { |
35 var bytes = test[0]; | 35 var bytes = test[0]; |
36 var expected = test[1]; | 36 var expected = test[1]; |
37 runTest(bytes, expected); | 37 runTest(bytes, expected); |
38 } | 38 } |
39 } | 39 } |
OLD | NEW |