Chromium Code Reviews| Index: tests/standalone/io/platform_executable_test.dart |
| diff --git a/tests/standalone/io/platform_executable_test.dart b/tests/standalone/io/platform_executable_test.dart |
| index 60dd47dad1013e4992d2137cf785e26d2f4e79fb..0340e64faca0bf5058de01848f923c8f732fffa3 100644 |
| --- a/tests/standalone/io/platform_executable_test.dart |
| +++ b/tests/standalone/io/platform_executable_test.dart |
| @@ -8,6 +8,8 @@ library PlatformExecutableTest; |
| import "dart:io"; |
| +const _SCRIPT_KEY = '_test_script'; |
| + |
| void expectEquals(a, b) { |
| if (a != b) { |
| throw 'Expected: $a\n' |
| @@ -16,7 +18,7 @@ void expectEquals(a, b) { |
| } |
| void verify(String exePath, {String altPath}) { |
| - var env = {'SCRIPT': 'yes'}; |
| + var env = {_SCRIPT_KEY: 'yes'}; |
| if (altPath != null) { |
| env['PATH'] = altPath; |
| } |
| @@ -44,13 +46,16 @@ void testDartExecShouldNotBeInCurrentDir() { |
| void testShouldFailOutsidePath() { |
| var threw = false; |
| try { |
| - Process.runSync(platformExeName, [scriptPath], |
| - includeParentEnvironment: false, environment: {'SCRIPT': 'yes'}); |
| + Process.runSync(platformExeName, [platformExeName], |
|
Søren Gjesse
2015/05/26 07:27:54
Why are you passing [platformExeName] here?
|
| + includeParentEnvironment: false, environment: {_SCRIPT_KEY: 'yes'}); |
| } catch (_) { |
| threw = true; |
| } |
| - expectEquals(true, threw); |
| + if (!threw) { |
| + throw 'Expected running the dart executable – "$platformExeName" without' |
| + ' the parent environment or path to fail.'; |
| + } |
| } |
| void testShouldSucceedWithSourcePlatformExecutable() { |
| @@ -131,7 +136,7 @@ String get platformExeName { |
| String get scriptPath => Platform.script.toFilePath(); |
| void main() { |
| - if (Platform.environment.containsKey('SCRIPT')) { |
| + if (Platform.environment.containsKey(_SCRIPT_KEY)) { |
| print(Platform.executable); |
| return; |
| } |