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

Side by Side Diff: test/run/app_can_read_from_stdin_test.dart

Issue 1215833002: Use the new test runner. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 '../descriptor.dart' as d; 5 import '../descriptor.dart' as d;
6 import '../test_pub.dart'; 6 import '../test_pub.dart';
7 7
8 const SCRIPT = """ 8 const SCRIPT = """
9 import 'dart:io'; 9 import 'dart:io';
10 10
11 main() { 11 main() {
12 print("started"); 12 print("started");
13 var line1 = stdin.readLineSync(); 13 var line1 = stdin.readLineSync();
14 print("between"); 14 print("between");
15 var line2 = stdin.readLineSync(); 15 var line2 = stdin.readLineSync();
16 print(line1); 16 print(line1);
17 print(line2); 17 print(line2);
18 } 18 }
19 """; 19 """;
20 20
21 main() { 21 main() {
22 initConfig();
23 integration('the spawned application can read from stdin', () { 22 integration('the spawned application can read from stdin', () {
24 d.dir(appPath, [ 23 d.dir(appPath, [
25 d.appPubspec(), 24 d.appPubspec(),
26 d.dir("bin", [ 25 d.dir("bin", [
27 d.file("script.dart", SCRIPT) 26 d.file("script.dart", SCRIPT)
28 ]) 27 ])
29 ]).create(); 28 ]).create();
30 29
31 var pub = pubRun(args: ["bin/script"]); 30 var pub = pubRun(args: ["bin/script"]);
32 31
33 pub.stdout.expect("started"); 32 pub.stdout.expect("started");
34 pub.writeLine("first"); 33 pub.writeLine("first");
35 pub.stdout.expect("between"); 34 pub.stdout.expect("between");
36 pub.writeLine("second"); 35 pub.writeLine("second");
37 pub.stdout.expect("first"); 36 pub.stdout.expect("first");
38 pub.stdout.expect("second"); 37 pub.stdout.expect("second");
39 pub.shouldExit(0); 38 pub.shouldExit(0);
40 }); 39 });
41 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698