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

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

Issue 20908002: Fix readLineSync to work in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
« no previous file with comments | « sdk/lib/io/stdio.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:path/path.dart"; 5 import "package:path/path.dart";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:json"; 7 import "dart:json";
8 8
9 void testReadByte() { 9 void testReadByte() {
10 void test(String line, List<String> expected) { 10 void test(String line, List<String> expected) {
11 var script = join(dirname(Platform.script), "stdin_sync_script.dart"); 11 var script = join(dirname(Platform.script), "stdin_sync_script.dart");
12 Process.start(Platform.executable, 12 Process.start(Platform.executable,
13 [script]..addAll( 13 ["--checked", script]..addAll(
14 expected.map(stringify))).then((process) { 14 expected.map(stringify))).then((process) {
15 process.stdin.write(line); 15 process.stdin.write(line);
16 process.stdin.close(); 16 process.stdin.close();
17 process.stderr 17 process.stderr
18 .transform(new StringDecoder()) 18 .transform(new StringDecoder())
19 .transform(new LineTransformer()) 19 .transform(new LineTransformer())
20 .fold(new StringBuffer(), (b, d) => b..write(d)) 20 .fold(new StringBuffer(), (b, d) => b..write(d))
21 .then((data) { 21 .then((data) {
22 if (data.toString() != '') throw "Bad output: '$data'"; 22 if (data.toString() != '') throw "Bad output: '$data'";
23 }); 23 });
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 61
62 void main() { 62 void main() {
63 testReadByte(); 63 testReadByte();
64 64
65 // testEchoMode and testLineMode is an developer-interactive test, thus not 65 // testEchoMode and testLineMode is an developer-interactive test, thus not
66 // enabled. 66 // enabled.
67 //testEchoMode(); 67 //testEchoMode();
68 //testLineMode(); 68 //testLineMode();
69 } 69 }
OLDNEW
« no previous file with comments | « sdk/lib/io/stdio.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698