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

Unified Diff: tests/corelib/uri_query_test.dart

Issue 16108003: Avoid parsing path and query string more than once (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
« tests/corelib/uri_path_test.dart ('K') | « tests/corelib/uri_path_test.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_query_test.dart
diff --git a/tests/corelib/uri_query_test.dart b/tests/corelib/uri_query_test.dart
index acbe9d8b2b49cbd2b38ea716ef2abfbdca9d2fda..ae571fc86c7cfb8f18bcb871709051ab960b1dd8 100644
--- a/tests/corelib/uri_query_test.dart
+++ b/tests/corelib/uri_query_test.dart
@@ -71,8 +71,6 @@ void testQueryParameters() {
}
encoded = encoded.toString();
unencoded = unencoded.toString();
- print(encoded);
- print(unencoded);
test("a=$encoded", {"a": unencoded});
test("a=$encoded&b=$encoded", {"a": unencoded, "b": unencoded});
@@ -113,9 +111,20 @@ testInvalidQueryParameters() {
test("&=xxx&=xxx&", {});
}
+testQueryParametersParsedOnce() {
+ var uri = Uri.parse("?a=b&c=d");
+ Expect.isTrue(identical(uri.queryParameters, uri.queryParameters));
Lasse Reichstein Nielsen 2013/05/30 11:57:50 Ditto here, don't specify it and don't test for it
Søren Gjesse 2013/05/30 13:38:25 Done.
+
+ var map = {"a": "b", "c": "d"};
+ uri = new Uri(queryParameters: map);
+ Expect.isFalse(identical(map, uri.queryParameters));
+ Expect.isTrue(identical(uri.queryParameters, uri.queryParameters));
+}
+
main() {
testInvalidArguments();
testEncodeQueryComponent();
testQueryParameters();
testInvalidQueryParameters();
+ testQueryParametersParsedOnce();
}
« tests/corelib/uri_path_test.dart ('K') | « tests/corelib/uri_path_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698