| 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:isolate"; | 7 import "dart:isolate"; |
| 8 import "process_test_util.dart"; | 8 import "process_test_util.dart"; |
| 9 | 9 |
| 10 runEnvironmentProcess(Map environment, name, includeParent, callback) { | 10 runEnvironmentProcess(Map environment, name, includeParent, callback) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 }); | 46 }); |
| 47 }); | 47 }); |
| 48 // Only check one value to not spin up too many processes testing the | 48 // Only check one value to not spin up too many processes testing the |
| 49 // same things. | 49 // same things. |
| 50 break; | 50 break; |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 testNoIncludeEnvironment() { | 54 testNoIncludeEnvironment() { |
| 55 var donePort = new ReceivePort(); | 55 var donePort = new ReceivePort(); |
| 56 runEnvironmentProcess({}, "PATH", false, (output) { | 56 var env = Platform.environment; |
| 57 Expect.isTrue(env.containsKey('PATH')); |
| 58 env.remove('PATH'); |
| 59 runEnvironmentProcess(env, "PATH", false, (output) { |
| 57 donePort.close(); | 60 donePort.close(); |
| 58 Expect.isTrue(output.startsWith("null")); | 61 Expect.isTrue(output.startsWith("null")); |
| 59 }); | 62 }); |
| 60 } | 63 } |
| 61 | 64 |
| 62 main() { | 65 main() { |
| 63 testEnvironment(); | 66 testEnvironment(); |
| 64 testNoIncludeEnvironment(); | 67 testNoIncludeEnvironment(); |
| 65 } | 68 } |
| OLD | NEW |