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

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

Issue 2439053005: Fix bug in test expectation for uri_platform test. (Closed)
Patch Set: use path package's rootPrefix Created 4 years, 1 month 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 | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/uri_platform_test.dart
diff --git a/tests/standalone/io/uri_platform_test.dart b/tests/standalone/io/uri_platform_test.dart
index cc677606eababae1fe6a2fca603a4b04a7f00ad3..e18d1f8137a97adc78024e243e33c39a0e9245e8 100644
--- a/tests/standalone/io/uri_platform_test.dart
+++ b/tests/standalone/io/uri_platform_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
+import 'package:path/path.dart';
zra 2016/11/07 15:53:05 as path
Florian Schneider 2016/11/07 15:58:26 Done. We don't seem to follow a system when using
import "dart:io";
main() {
@@ -36,7 +37,12 @@ main() {
Expect.equals("a/b", new Uri.file("a/b").toFilePath());
Expect.equals("a\\b", new Uri.file("a\\b").toFilePath());
}
-
- Expect.equals(Uri.base,
- new Uri.file(Directory.current.path + Platform.pathSeparator));
+ // If the current path is only the root prefix (/ (or c:\), then don't add a
+ // separator at the end.
+ Expect.equals(
+ Uri.base,
+ (Directory.current.path.toString() !=
+ rootPrefix(Directory.current.path.toString()))
zra 2016/11/07 15:53:05 path.rootPrefix
Florian Schneider 2016/11/07 15:58:26 Done.
+ ? new Uri.file(Directory.current.path + Platform.pathSeparator)
+ : new Uri.file(Directory.current.path));
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698