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

Unified Diff: tests/utils/uri_test.dart

Issue 10919239: Change Uri.fromComponents to take named optional arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « lib/uri/uri.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/utils/uri_test.dart
diff --git a/tests/utils/uri_test.dart b/tests/utils/uri_test.dart
index d25b699fc4022198e1835119990fb7215fc0d9a0..88771479b2f0e97fc87fee434dda33ac1e619c34 100644
--- a/tests/utils/uri_test.dart
+++ b/tests/utils/uri_test.dart
@@ -93,12 +93,22 @@ main() {
false);
Expect.stringEquals("http://user@example.com:80/a/b/c?query#fragment",
const Uri.fromComponents(
- "http", "user", "example.com", 80, "/a/b/c",
- "query", "fragment").toString());
+ scheme: "http",
+ userInfo: "user",
+ domain: "example.com",
+ port: 80,
+ path: "/a/b/c",
+ query: "query",
+ fragment: "fragment").toString());
Expect.stringEquals("null://null@null/a/b/c/?null#null",
const Uri.fromComponents(
- null, null, null, 0, "/a/b/c/",
- null, null).toString());
+ scheme: null,
+ userInfo: null,
+ domain: null,
+ port: 0,
+ path: "/a/b/c/",
+ query: null,
+ fragment: null).toString());
Expect.stringEquals("file://", new Uri.fromString("file:").toString());
Expect.stringEquals("file://", new Uri("file:").toString());
Expect.stringEquals("/a/g", removeDotSegments("/a/b/c/./../../g"));
@@ -135,18 +145,36 @@ main() {
(e) { return e is IllegalArgumentException; },
"origin for uri with empty domain should fail");
Expect.throws(
- () => const Uri.fromComponents("http", null, "", 80, "/a/b/c",
- "query", "fragment").origin,
+ () => const Uri.fromComponents(
+ scheme: "http",
+ userInfo: null,
+ domain: "",
+ port: 80,
+ path: "/a/b/c",
+ query: "query",
+ fragment: "fragment").origin,
(e) { return e is IllegalArgumentException; },
"origin for uri with empty domain should fail");
Expect.throws(
- () => const Uri.fromComponents(null, null, "", 80, "/a/b/c",
- "query", "fragment").origin,
+ () => const Uri.fromComponents(
+ scheme: null,
+ userInfo: null,
+ domain: "",
+ port: 80,
+ path: "/a/b/c",
+ query: "query",
+ fragment: "fragment").origin,
(e) { return e is IllegalArgumentException; },
"origin for uri with empty scheme should fail");
Expect.throws(
- () => const Uri.fromComponents("http", null, null, 80, "/a/b/c",
- "query", "fragment").origin,
+ () => const Uri.fromComponents(
+ scheme: "http",
+ userInfo: null,
+ domain: null,
+ port: 80,
+ path: "/a/b/c",
+ query: "query",
+ fragment: "fragment").origin,
(e) { return e is IllegalArgumentException; },
"origin for uri with empty domain should fail");
Expect.throws(
@@ -162,7 +190,7 @@ main() {
// Note: dart2js won't handle '\ud800\udc00' and frog
// won't handle '\u{10000}'. So we cons this up synthetically...
var s = decodeUtf8([0xf0, 0x90, 0x80, 0x80]);
-
+
testEncodeDecode("\uFFFE", "%EF%BF%BE");
testEncodeDecode("\uFFFF", "%EF%BF%BF");
testEncodeDecode("\uFFFE", "%EF%BF%BE");
« no previous file with comments | « lib/uri/uri.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698