| OLD | NEW |
| 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 |
| OLD | NEW |