| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:math'; | 6 import 'dart:math'; |
| 7 | 7 |
| 8 import "package:unittest/unittest.dart"; | 8 import "package:test/test.dart"; |
| 9 import "package:mime/mime.dart"; | 9 import "package:mime/mime.dart"; |
| 10 | 10 |
| 11 void _writeInChunks(List<int> data, | 11 void _writeInChunks(List<int> data, |
| 12 int chunkSize, | 12 int chunkSize, |
| 13 StreamController<List<int>> controller) { | 13 StreamController<List<int>> controller) { |
| 14 if (chunkSize == -1) chunkSize = data.length; | 14 if (chunkSize == -1) chunkSize = data.length; |
| 15 | 15 |
| 16 int written = 0; | 16 int written = 0; |
| 17 for (int pos = 0; pos < data.length; pos += chunkSize) { | 17 for (int pos = 0; pos < data.length; pos += chunkSize) { |
| 18 int remaining = data.length - pos; | 18 int remaining = data.length - pos; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 \r | 456 \r |
| 457 Body2\r | 457 Body2\r |
| 458 --xxx\r\n"""; | 458 --xxx\r\n"""; |
| 459 _testParse(message, "xxx", null, [null, null], true); | 459 _testParse(message, "xxx", null, [null, null], true); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void main() { | 462 void main() { |
| 463 _testParseValid(); | 463 _testParseValid(); |
| 464 _testParseInvalid(); | 464 _testParseInvalid(); |
| 465 } | 465 } |
| OLD | NEW |