| 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:convert'; | 5 import 'dart:convert'; |
| 6 import "dart:typed_data"; | 6 import "dart:typed_data"; |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 for (var list in [<int>[], | 10 for (var list in [<int>[], |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 badChunkEncode([0, 0, invalid]); | 260 badChunkEncode([0, 0, invalid]); |
| 261 badChunkEncode([0, invalid, 0]); | 261 badChunkEncode([0, invalid, 0]); |
| 262 badChunkEncode([invalid, 0, 0]); | 262 badChunkEncode([invalid, 0, 0]); |
| 263 } | 263 } |
| 264 | 264 |
| 265 badEncode(-1); | 265 badEncode(-1); |
| 266 badEncode(0x100); | 266 badEncode(0x100); |
| 267 badEncode(0x1000); | 267 badEncode(0x1000); |
| 268 badEncode(0x10000); | 268 badEncode(0x10000); |
| 269 // TODO(rnystrom): These aren't throwing in dev_compiler. Figure out why. | 269 // TODO(rnystrom): These aren't throwing in dev_compiler. Figure out why. |
| 270 // badEncode(0x100000000); /// 01: ok | 270 // badEncode(0x100000000); // /// 01: ok |
| 271 // badEncode(0x10000000000000000); /// 01: continued | 271 // badEncode(0x10000000000000000); // /// 01: continued |
| 272 } | 272 } |
| 273 | 273 |
| 274 void testIssue25577() { | 274 void testIssue25577() { |
| 275 // Regression test for http://dartbug.com/25577 | 275 // Regression test for http://dartbug.com/25577 |
| 276 // Should not fail in checked mode. | 276 // Should not fail in checked mode. |
| 277 StringConversionSink decodeSink = | 277 StringConversionSink decodeSink = |
| 278 BASE64.decoder.startChunkedConversion(new TestSink<List<int>>()); | 278 BASE64.decoder.startChunkedConversion(new TestSink<List<int>>()); |
| 279 ByteConversionSink encodeSink = | 279 ByteConversionSink encodeSink = |
| 280 BASE64.encoder.startChunkedConversion(new TestSink<String>()); | 280 BASE64.encoder.startChunkedConversion(new TestSink<String>()); |
| 281 } | 281 } |
| 282 | 282 |
| 283 // Implementation of Sink<T> to test type constraints. | 283 // Implementation of Sink<T> to test type constraints. |
| 284 class TestSink<T> implements Sink<T> { | 284 class TestSink<T> implements Sink<T> { |
| 285 void add(T value) {} | 285 void add(T value) {} |
| 286 void close() {} | 286 void close() {} |
| 287 } | 287 } |
| OLD | NEW |