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

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

Issue 19967002: Remove uses of Path class from tests/standalone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix windows error Created 7 years, 5 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:path/path.dart";
5 import "dart:io"; 6 import "dart:io";
6 import "dart:json"; 7 import "dart:json";
7 8
8 void test(String line, List<String> expected) { 9 void test(String line, List<String> expected) {
9 var script = new Path(Platform.script).directoryPath; 10 var script = join(dirname(Platform.script), "stdin_sync_script.dart");
10 script = script.append("stdin_sync_script.dart");
11 Process.start(Platform.executable, 11 Process.start(Platform.executable,
12 [script.toNativePath()]..addAll( 12 [script]..addAll(
13 expected.map(stringify))).then((process) { 13 expected.map(stringify))).then((process) {
14 process.stdin.write(line); 14 process.stdin.write(line);
15 process.stdin.close(); 15 process.stdin.close();
16 process.stderr 16 process.stderr
17 .transform(new StringDecoder()) 17 .transform(new StringDecoder())
18 .transform(new LineTransformer()) 18 .transform(new LineTransformer())
19 .fold(new StringBuffer(), (b, d) => b..write(d)) 19 .fold(new StringBuffer(), (b, d) => b..write(d))
20 .then((data) { 20 .then((data) {
21 if (data.toString() != '') throw "Bad output: '$data'"; 21 if (data.toString() != '') throw "Bad output: '$data'";
22 }); 22 });
(...skipping 16 matching lines...) Expand all
39 39
40 if (Platform.isWindows) { 40 if (Platform.isWindows) {
41 // Windows trim one of the \r. 41 // Windows trim one of the \r.
42 test("hej\r\r\r\nhej\r\nhej\r", ['hej\r', 'hej', 'hej\r']); 42 test("hej\r\r\r\nhej\r\nhej\r", ['hej\r', 'hej', 'hej\r']);
43 } else { 43 } else {
44 test("hej\r\r\nhej\r\nhej\r", ['hej\r', 'hej', 'hej\r']); 44 test("hej\r\r\nhej\r\nhej\r", ['hej\r', 'hej', 'hej\r']);
45 } 45 }
46 46
47 test("hej", ['hej']); 47 test("hej", ['hej']);
48 } 48 }
OLDNEW
« no previous file with comments | « tests/standalone/io/socket_upgrade_to_secure_test.dart ('k') | tests/standalone/io/test_extension_fail_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698