Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: tests/standalone/io/platform_test.dart

Issue 953323002: Fix broken test of platform version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/platform_test.dart
diff --git a/tests/standalone/io/platform_test.dart b/tests/standalone/io/platform_test.dart
index b0036f6ebcef94032727fce185e7f7a3dbd65393..e3ee4d43780f0905b42637276ed4352876aaf596 100644
--- a/tests/standalone/io/platform_test.dart
+++ b/tests/standalone/io/platform_test.dart
@@ -86,13 +86,23 @@ testVersion() {
Expect.isTrue(int.parse(match.group(6)) >= 0);
}
}
+
+ String stripAdditionalInfo(String version) {
+ var index = version.indexOf(' ');
+ if (index == -1) return version;
+ return version.substring(0, index);
+ }
+
// Ensure we can match valid versions.
checkValidVersion('1.9.0');
checkValidVersion('1.9.0-dev.0.0');
checkValidVersion('1.9.0-edge');
checkValidVersion('1.9.0-edge.r41234');
+ // Check stripping of additional information.
+ checkValidVersion(stripAdditionalInfo(
+ '1.9.0-dev.1.2 (Wed Feb 25 02:22:19 2015) on "linux_ia32"'));
// Test current version.
- checkValidVersion(Platform.version);
+ checkValidVersion(stripAdditionalInfo(Platform.version));
// Test some invalid versions.
Expect.throws(() => checkValidVersion('1.9'));
Expect.throws(() => checkValidVersion('2.0.0'));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698