| 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:async"; | 5 import "dart:async"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:isolate"; | 7 import "dart:isolate"; |
| 8 | 8 |
| 9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 Expect.isTrue(Platform.executable.endsWith('dart.exe')); | 31 Expect.isTrue(Platform.executable.endsWith('dart.exe')); |
| 32 Expect.isTrue(Platform.resolvedExecutable.endsWith('dart.exe')); | 32 Expect.isTrue(Platform.resolvedExecutable.endsWith('dart.exe')); |
| 33 } | 33 } |
| 34 if (!Platform.isWindows) { | 34 if (!Platform.isWindows) { |
| 35 Expect.isTrue(Platform.resolvedExecutable.startsWith('/')); | 35 Expect.isTrue(Platform.resolvedExecutable.startsWith('/')); |
| 36 } else { | 36 } else { |
| 37 // This assumes that tests (both locally and on the bots) are | 37 // This assumes that tests (both locally and on the bots) are |
| 38 // running off a location referred to by a drive letter. If a UNC | 38 // running off a location referred to by a drive letter. If a UNC |
| 39 // location is used or long names ("\\?\" prefix) is used this | 39 // location is used or long names ("\\?\" prefix) is used this |
| 40 // needs to be fixed. | 40 // needs to be fixed. |
| 41 Expect.equals(Platform.executable.substring(1, 3), ':\\'); | 41 Expect.equals(Platform.resolvedExecutable.substring(1, 3), ':\\'); |
| 42 } | 42 } |
| 43 // Move directory to be sure script is correct. | 43 // Move directory to be sure script is correct. |
| 44 var oldDir = Directory.current; | 44 var oldDir = Directory.current; |
| 45 Directory.current = Directory.current.parent; | 45 Directory.current = Directory.current.parent; |
| 46 Expect.isTrue(Platform.script.path. | 46 Expect.isTrue(Platform.script.path. |
| 47 endsWith('tests/standalone/io/platform_test.dart')); | 47 endsWith('tests/standalone/io/platform_test.dart')); |
| 48 Expect.isTrue(Platform.script.toFilePath().startsWith(oldDir.path)); | 48 Expect.isTrue(Platform.script.toFilePath().startsWith(oldDir.path)); |
| 49 // Restore dir. | 49 // Restore dir. |
| 50 Directory.current = oldDir; | 50 Directory.current = oldDir; |
| 51 Directory packageRoot = new Directory(Platform.packageRoot); | 51 Directory packageRoot = new Directory(Platform.packageRoot); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 Expect.throws(() => checkValidVersion('x.y.z')); | 132 Expect.throws(() => checkValidVersion('x.y.z')); |
| 133 } | 133 } |
| 134 | 134 |
| 135 main() { | 135 main() { |
| 136 // This tests assumes paths relative to dart main directory | 136 // This tests assumes paths relative to dart main directory |
| 137 Directory.current = Platform.script.resolve('../../..').toFilePath(); | 137 Directory.current = Platform.script.resolve('../../..').toFilePath(); |
| 138 test(); | 138 test(); |
| 139 testIsolate(); | 139 testIsolate(); |
| 140 testVersion(); | 140 testVersion(); |
| 141 } | 141 } |
| OLD | NEW |