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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 .transform(new LineTransformer()); | 193 .transform(new LineTransformer()); |
194 stream.listen( | 194 stream.listen( |
195 (_) {}, | 195 (_) {}, |
196 onDone: () { | 196 onDone: () { |
197 Expect.equals(1, errors); | 197 Expect.equals(1, errors); |
198 }, | 198 }, |
199 onError: (e) { | 199 onError: (e) { |
200 errors++; | 200 errors++; |
201 Expect.isTrue(e.error is TestException); | 201 Expect.isTrue(e.error is TestException); |
202 }); | 202 }); |
203 controller.signalError(new TestException()); | 203 controller.addError(new TestException()); |
204 controller.close(); | 204 controller.close(); |
205 } | 205 } |
206 | 206 |
207 testLatin1EncoderError() { | 207 testLatin1EncoderError() { |
208 List<int> data = [0x01, | 208 List<int> data = [0x01, |
209 0x7f, | 209 0x7f, |
210 0x44, 0x61, 0x72, 0x74, | 210 0x44, 0x61, 0x72, 0x74, |
211 0x80, | 211 0x80, |
212 0xff, | 212 0xff, |
213 0x100]; | 213 0x100]; |
(...skipping 14 matching lines...) Expand all Loading... |
228 | 228 |
229 main() { | 229 main() { |
230 testUtf8(); | 230 testUtf8(); |
231 testLatin1(); | 231 testLatin1(); |
232 testAscii(); | 232 testAscii(); |
233 testReadLine1(); | 233 testReadLine1(); |
234 testReadLine2(); | 234 testReadLine2(); |
235 testErrorHandler(); | 235 testErrorHandler(); |
236 testLatin1EncoderError(); | 236 testLatin1EncoderError(); |
237 } | 237 } |
OLD | NEW |