| 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:async"; | 5 import "dart:async"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:isolate"; | 7 import "dart:isolate"; |
| 8 import "dart:utf"; | 8 import "dart:utf"; |
| 9 | 9 |
| 10 void testUtf8() { | 10 void testUtf8() { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 var controller = new StreamController(); | 214 var controller = new StreamController(); |
| 215 controller.add(new String.fromCharCodes(data)); | 215 controller.add(new String.fromCharCodes(data)); |
| 216 controller.close(); | 216 controller.close(); |
| 217 var stream = controller.stream | 217 var stream = controller.stream |
| 218 .transform(new StringEncoder(Encoding.ISO_8859_1)); | 218 .transform(new StringEncoder(Encoding.ISO_8859_1)); |
| 219 stream.listen( | 219 stream.listen( |
| 220 (s) { | 220 (s) { |
| 221 Expect.fail("data not expected"); | 221 Expect.fail("data not expected"); |
| 222 }, | 222 }, |
| 223 onError: (error) { | 223 onError: (error) { |
| 224 print(error); | |
| 225 Expect.isTrue(error.error is FormatException); | 224 Expect.isTrue(error.error is FormatException); |
| 226 }); | 225 }); |
| 227 | 226 |
| 228 } | 227 } |
| 229 | 228 |
| 230 main() { | 229 main() { |
| 231 testUtf8(); | 230 testUtf8(); |
| 232 testLatin1(); | 231 testLatin1(); |
| 233 testAscii(); | 232 testAscii(); |
| 234 testReadLine1(); | 233 testReadLine1(); |
| 235 testReadLine2(); | 234 testReadLine2(); |
| 236 testErrorHandler(); | 235 testErrorHandler(); |
| 237 testLatin1EncoderError(); | 236 testLatin1EncoderError(); |
| 238 } | 237 } |
| OLD | NEW |