| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart')); | 61 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart')); |
| 62 Expect.equals(Platform.packageRoot, results["Platform.packageRoot"]); | 62 Expect.equals(Platform.packageRoot, results["Platform.packageRoot"]); |
| 63 Expect.listEquals(Platform.executableArguments, | 63 Expect.listEquals(Platform.executableArguments, |
| 64 results["Platform.executableArguments"]); | 64 results["Platform.executableArguments"]); |
| 65 asyncEnd(); | 65 asyncEnd(); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 testVersion() { | 70 testVersion() { |
| 71 checkValidVersion(string version) { | 71 checkValidVersion(String version) { |
| 72 RegExp re = new RegExp(r'(\d+)\.(\d+)\.(\d+)(-dev\.([^\.]*)\.([^\.]*))?'); | 72 RegExp re = new RegExp(r'(\d+)\.(\d+)\.(\d+)(-dev\.([^\.]*)\.([^\.]*))?'); |
| 73 var match = re.firstMatch(version); | 73 var match = re.firstMatch(version); |
| 74 Expect.isNotNull(match); | 74 Expect.isNotNull(match); |
| 75 // Major version. | 75 // Major version. |
| 76 Expect.isTrue(int.parse(match.group(1)) == 1); | 76 Expect.isTrue(int.parse(match.group(1)) == 1); |
| 77 // Minor version. | 77 // Minor version. |
| 78 Expect.isTrue(int.parse(match.group(2)) >= 9); | 78 Expect.isTrue(int.parse(match.group(2)) >= 9); |
| 79 // Patch version. | 79 // Patch version. |
| 80 Expect.isTrue(int.parse(match.group(3)) >= 0); | 80 Expect.isTrue(int.parse(match.group(3)) >= 0); |
| 81 // Dev | 81 // Dev |
| (...skipping 25 matching lines...) Expand all Loading... |
| 107 Expect.throws(() => checkValidVersion('x.y.z')); | 107 Expect.throws(() => checkValidVersion('x.y.z')); |
| 108 } | 108 } |
| 109 | 109 |
| 110 main() { | 110 main() { |
| 111 // This tests assumes paths relative to dart main directory | 111 // This tests assumes paths relative to dart main directory |
| 112 Directory.current = Platform.script.resolve('../../..').toFilePath(); | 112 Directory.current = Platform.script.resolve('../../..').toFilePath(); |
| 113 test(); | 113 test(); |
| 114 testIsolate(); | 114 testIsolate(); |
| 115 testVersion(); | 115 testVersion(); |
| 116 } | 116 } |
| OLD | NEW |