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

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

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding stable test binaries Created 8 years, 7 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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:io"); 5 #import("dart:io");
6 #source("process_test_util.dart"); 6 #source("process_test_util.dart");
7 7
8 test(args) { 8 test(args) {
9 Process process = new Process.start(new Options().executable, args); 9 Process process = Process.start(new Options().executable, args);
10 // Wait for the process to exit and then check result. 10 // Wait for the process to exit and then check result.
11 process.onExit = (exitCode) { 11 process.onExit = (exitCode) {
12 Expect.equals(0, exitCode); 12 Expect.equals(0, exitCode);
13 process.close(); 13 process.close();
14 }; 14 };
15 } 15 }
16 16
17 main() { 17 main() {
18 // Get the Dart script file which checks arguments. 18 // Get the Dart script file which checks arguments.
19 var scriptFile = 19 var scriptFile =
20 new File("tests/standalone/io/process_check_arguments_script.dart"); 20 new File("tests/standalone/io/process_check_arguments_script.dart");
21 if (!scriptFile.existsSync()) { 21 if (!scriptFile.existsSync()) {
22 scriptFile = 22 scriptFile =
23 new File("../tests/standalone/io/process_check_arguments_script.dart"); 23 new File("../tests/standalone/io/process_check_arguments_script.dart");
24 } 24 }
25 test([scriptFile.name, '3', '0', 'a']); 25 test([scriptFile.name, '3', '0', 'a']);
26 test([scriptFile.name, '3', '0', 'a b']); 26 test([scriptFile.name, '3', '0', 'a b']);
27 test([scriptFile.name, '3', '0', 'a\tb']); 27 test([scriptFile.name, '3', '0', 'a\tb']);
28 test([scriptFile.name, '3', '1', 'a\tb"']); 28 test([scriptFile.name, '3', '1', 'a\tb"']);
29 test([scriptFile.name, '3', '1', 'a"\tb']); 29 test([scriptFile.name, '3', '1', 'a"\tb']);
30 test([scriptFile.name, '3', '1', 'a"\t\\\\"b"']); 30 test([scriptFile.name, '3', '1', 'a"\t\\\\"b"']);
31 test([scriptFile.name, '4', '0', 'a\tb', 'a']); 31 test([scriptFile.name, '4', '0', 'a\tb', 'a']);
32 test([scriptFile.name, '4', '0', 'a\tb', 'a\t\t\t\tb']); 32 test([scriptFile.name, '4', '0', 'a\tb', 'a\t\t\t\tb']);
33 test([scriptFile.name, '4', '0', 'a\tb', 'a b']); 33 test([scriptFile.name, '4', '0', 'a\tb', 'a b']);
34 } 34 }
35 35
OLDNEW
« no previous file with comments | « tests/standalone/io/process_broken_pipe_test.dart ('k') | tests/standalone/io/process_environment_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698