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