| 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:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
| 9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void testZLibDeflateRaw() { | 83 void testZLibDeflateRaw() { |
| 84 asyncStart(); | 84 asyncStart(); |
| 85 var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | 85 var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; |
| 86 var controller = new StreamController(sync: true); | 86 var controller = new StreamController(sync: true); |
| 87 controller.stream.transform(new ZLibEncoder(raw: true, level: 6)) | 87 controller.stream.transform(new ZLibEncoder(raw: true, level: 6)) |
| 88 .fold([], (buffer, data) { | 88 .fold([], (buffer, data) { |
| 89 buffer.addAll(data); | 89 buffer.addAll(data); |
| 90 return buffer; | 90 return buffer; |
| 91 }) | 91 }) |
| 92 .then((data) { | 92 .then((data) { |
| 93 print(data); | |
| 94 Expect.listEquals([99, 96, 100, 98, 102, 97, 101, 99, 231, 224, 4, 0], | 93 Expect.listEquals([99, 96, 100, 98, 102, 97, 101, 99, 231, 224, 4, 0], |
| 95 data); | 94 data); |
| 96 asyncEnd(); | 95 asyncEnd(); |
| 97 }); | 96 }); |
| 98 controller.add(data); | 97 controller.add(data); |
| 99 controller.close(); | 98 controller.close(); |
| 100 } | 99 } |
| 101 | 100 |
| 102 void testZLibDeflateInvalidLevel() { | 101 void testZLibDeflateInvalidLevel() { |
| 103 test2(gzip, level) { | 102 test2(gzip, level) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 testZLibDeflateInvalidLevel(); | 228 testZLibDeflateInvalidLevel(); |
| 230 testZLibInflate(); | 229 testZLibInflate(); |
| 231 testZLibInflateSync(); | 230 testZLibInflateSync(); |
| 232 testZlibInflateThrowsWithSmallerWindow(); | 231 testZlibInflateThrowsWithSmallerWindow(); |
| 233 testZlibInflateWithLargerWindow(); | 232 testZlibInflateWithLargerWindow(); |
| 234 testZLibDeflateRaw(); | 233 testZLibDeflateRaw(); |
| 235 testZLibInflateRaw(); | 234 testZLibInflateRaw(); |
| 236 testZlibWithDictionary(); | 235 testZlibWithDictionary(); |
| 237 asyncEnd(); | 236 asyncEnd(); |
| 238 } | 237 } |
| OLD | NEW |