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

Unified Diff: tests/corelib/uri_path_test.dart

Issue 22918029: Change the type of the pathSegments argument to the Uri constructor from List to Iterable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 4 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 | « sdk/lib/core/uri.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/uri_path_test.dart
diff --git a/tests/corelib/uri_path_test.dart b/tests/corelib/uri_path_test.dart
index 058d91237add29398173a1517aff3ddc74a1aad7..d1804f97b327ae54c1cba300cbedd5f94d81860b 100644
--- a/tests/corelib/uri_path_test.dart
+++ b/tests/corelib/uri_path_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import "dart:collection";
+
import "package:expect/expect.dart";
void testInvalidArguments() {
@@ -91,14 +93,36 @@ void testPathSegments() {
test(encoded + "/" + encoded, [unencoded, unencoded]);
Uri uri;
- uri = new Uri(pathSegments: ["xxx", "yyy", "zzz"]);
+ List pathSegments = ["xxx", "yyy", "zzz"];
+
+ uri = new Uri(pathSegments: pathSegments);
+ Expect.equals(3, uri.pathSegments.length);
+ uri = new Uri(pathSegments: pathSegments.where((_) => true));
+ Expect.equals(3, uri.pathSegments.length);
+ uri = new Uri(pathSegments: new DoubleLinkedQueue.from(pathSegments));
+ Expect.equals(3, uri.pathSegments.length);
+
+ uri = new Uri(scheme: "http",
+ host: "host",
+ pathSegments: pathSegments);
Expect.equals(3, uri.pathSegments.length);
uri = new Uri(scheme: "http",
host: "host",
- pathSegments: ["xxx", "yyy", "zzz"]);
+ pathSegments: pathSegments.where((_) => true));
+ Expect.equals(3, uri.pathSegments.length);
+ uri = new Uri(scheme: "http",
+ host: "host",
+ pathSegments: new DoubleLinkedQueue.from(pathSegments));
+ Expect.equals(3, uri.pathSegments.length);
+
+ uri = new Uri(scheme: "file",
+ pathSegments: pathSegments);
+ Expect.equals(3, uri.pathSegments.length);
+ uri = new Uri(scheme: "file",
+ pathSegments: pathSegments.where((_) => true));
Expect.equals(3, uri.pathSegments.length);
uri = new Uri(scheme: "file",
- pathSegments: ["xxx", "yyy", "zzz"]);
+ pathSegments: new DoubleLinkedQueue.from(pathSegments));
Expect.equals(3, uri.pathSegments.length);
}
« no previous file with comments | « sdk/lib/core/uri.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698