Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "dart:io"; | 5 import "dart:io"; |
| 6 | 6 |
| 7 void testRunShell() { | 7 void testRunShell() { |
| 8 test(args) { | 8 test(args) { |
| 9 var options = new Options(); | 9 var options = new Options(); |
| 10 var path = new Path(options.script); | 10 var path = new Path(options.script); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 } | 26 } |
| 27 }); | 27 }); |
| 28 } | 28 } |
| 29 test(["\""]); | 29 test(["\""]); |
| 30 test(["a b"]); | 30 test(["a b"]); |
| 31 test(["'"]); | 31 test(["'"]); |
| 32 test(["'\"\"'\"'\"'"]); | 32 test(["'\"\"'\"'\"'"]); |
| 33 test(["'\"\"'", "\"'\"'"]); | 33 test(["'\"\"'", "\"'\"'"]); |
| 34 test(["'\$HOME'"]); | 34 test(["'\$HOME'"]); |
| 35 test(["'\$tmp'"]); | 35 test(["'\$tmp'"]); |
| 36 test(["arg'"]); | |
| 37 test(["arg\\'"]); | |
|
kustermann
2013/05/23 10:26:38
If you want to make sure that escaping works corre
Anders Johnsen
2013/05/23 15:22:57
Done.
| |
| 36 } | 38 } |
|
kustermann
2013/05/23 10:26:38
I've one more question regarding the functionality
Anders Johnsen
2013/05/23 15:22:57
Please see https://codereview.chromium.org/1588300
| |
| 37 | 39 |
| 38 void testShell() { | 40 void testShell() { |
| 39 test(args, expected) { | 41 test(args, expected) { |
| 40 var options = new Options(); | 42 var options = new Options(); |
| 41 var path = new Path(options.script); | 43 var path = new Path(options.script); |
| 42 path = path.directoryPath.join(new Path("process_echo_util.dart")); | 44 path = path.directoryPath.join(new Path("process_echo_util.dart")); |
| 43 var command = "${options.executable} $path $args"; | 45 var command = "${options.executable} $path $args"; |
| 44 Process.runShell(command, []) | 46 Process.runShell(command, []) |
| 45 .then((result) { | 47 .then((result) { |
| 46 if (Platform.operatingSystem == "windows") { | 48 if (Platform.operatingSystem == "windows") { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 63 if (Platform.operatingSystem != 'windows') { | 65 if (Platform.operatingSystem != 'windows') { |
| 64 test("arg1 arg2 > /dev/null", []); | 66 test("arg1 arg2 > /dev/null", []); |
| 65 } | 67 } |
| 66 } | 68 } |
| 67 | 69 |
| 68 void main() { | 70 void main() { |
| 69 testRunShell(); | 71 testRunShell(); |
| 70 testShell(); | 72 testShell(); |
| 71 } | 73 } |
| 72 | 74 |
| OLD | NEW |