| 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 // OtherResources=process_echo_util.dart |
| 6 |
| 5 import "package:path/path.dart"; | 7 import "package:path/path.dart"; |
| 6 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
| 7 import "dart:io"; | 9 import "dart:io"; |
| 8 import "dart:async"; | 10 import "dart:async"; |
| 9 import "dart:isolate"; | 11 import "dart:isolate"; |
| 10 | 12 |
| 11 void testRunShell() { | 13 void testRunShell() { |
| 12 test(args) { | 14 test(args) { |
| 13 asyncStart(); | 15 asyncStart(); |
| 14 var path = Platform.script.resolve("process_echo_util.dart").toFilePath(); | 16 var script = Platform.script.resolve("process_echo_util.dart").toFilePath(); |
| 15 Process.run(Platform.executable, | 17 Process.run(Platform.executable, |
| 16 [path]..addAll(args), | 18 [script]..addAll(args), |
| 17 runInShell: true) | 19 runInShell: true) |
| 18 .then((result) { | 20 .then((result) { |
| 19 if (Platform.operatingSystem == "windows") { | 21 if (Platform.operatingSystem == "windows") { |
| 20 result = result.stdout.split("\r\n"); | 22 result = result.stdout.split("\r\n"); |
| 21 } else { | 23 } else { |
| 22 result = result.stdout.split("\n"); | 24 result = result.stdout.split("\n"); |
| 23 } | 25 } |
| 24 if (result.length - 1 != args.length) { | 26 if (result.length - 1 != args.length) { |
| 25 throw "wrong number of args: $args vs $result"; | 27 throw "wrong number of args: $args vs $result"; |
| 26 } | 28 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 60 } |
| 59 test("'\"'"); | 61 test("'\"'"); |
| 60 test("'\$HOME'"); | 62 test("'\$HOME'"); |
| 61 } | 63 } |
| 62 | 64 |
| 63 void main() { | 65 void main() { |
| 64 testRunShell(); | 66 testRunShell(); |
| 65 testBadRunShell(); | 67 testBadRunShell(); |
| 66 } | 68 } |
| 67 | 69 |
| OLD | NEW |