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 | 6 |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
9 | 9 |
10 import "process_test_util.dart"; | 10 import "process_test_util.dart"; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Only check one value to not spin up too many processes testing the | 58 // Only check one value to not spin up too many processes testing the |
59 // same things. | 59 // same things. |
60 break; | 60 break; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 testNoIncludeEnvironment() { | 64 testNoIncludeEnvironment() { |
65 asyncStart(); | 65 asyncStart(); |
66 var env = Platform.environment; | 66 var env = Platform.environment; |
67 Expect.isTrue(env.containsKey('PATH')); | 67 Expect.isTrue(env.containsKey('PATH')); |
| 68 env = new Map.from(env); |
68 env.remove('PATH'); | 69 env.remove('PATH'); |
69 runEnvironmentProcess(env, "PATH", false, (output) { | 70 runEnvironmentProcess(env, "PATH", false, (output) { |
70 Expect.isTrue(output.startsWith("null")); | 71 Expect.isTrue(output.startsWith("null")); |
71 asyncEnd(); | 72 asyncEnd(); |
72 }); | 73 }); |
73 } | 74 } |
74 | 75 |
75 main() { | 76 main() { |
76 testEnvironment(); | 77 testEnvironment(); |
77 testNoIncludeEnvironment(); | 78 testNoIncludeEnvironment(); |
78 } | 79 } |
OLD | NEW |