Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: tests/standalone/io/regress_10026_test.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert';
7 import 'dart:io'; 8 import 'dart:io';
8 import 'dart:isolate'; 9 import 'dart:isolate';
9 10
10 void testZLibInflate_regress10026() { 11 void testZLibInflate_regress10026() {
11 test(data, expect) { 12 test(data, expect) {
12 var port = new ReceivePort(); 13 var port = new ReceivePort();
13 var controller = new StreamController(sync: true); 14 var controller = new StreamController(sync: true);
14 controller.stream 15 controller.stream
15 .transform(ZLIB.decoder) 16 .transform(ZLIB.decoder)
16 .transform(new StringDecoder()) 17 .transform(UTF8.decoder)
17 .fold(new StringBuffer(), (buffer, s) { 18 .fold(new StringBuffer(), (buffer, s) {
18 buffer.write(s); 19 buffer.write(s);
19 return buffer; 20 return buffer;
20 }) 21 })
21 .then((out) { 22 .then((out) {
22 Expect.equals(out.toString(), expect); 23 Expect.equals(out.toString(), expect);
23 port.close(); 24 port.close();
24 }); 25 });
25 controller.add(data); 26 controller.add(data);
26 controller.close(); 27 controller.close();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 </div> 131 </div>
131 </body> 132 </body>
132 </html> 133 </html>
133 '''); 134 ''');
134 } 135 }
135 136
136 void main() { 137 void main() {
137 testZLibInflate_regress10026(); 138 testZLibInflate_regress10026();
138 } 139 }
139 140
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698