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

Side by Side Diff: tests/corelib_strong/uri_parameters_all_test.dart

Issue 2983123002: Migrate test block 30 + corelib portion of block 31 to Dart 2.0. (Closed)
Patch Set: Addressed Bob's comments Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « tests/corelib_strong/uri_normalize_test.dart ('k') | tests/corelib_strong/uri_parse_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import 'dart:convert';
7
8 main() {
9 testAll(["a", "b", "c"]);
10 testAll([""]);
11 testAll(["a"]);
12 testAll(["", ""]);
13 testAll(["baz"]);
14
15 testParse("z&y&w&z", {
16 "z": ["", ""],
17 "y": [""],
18 "w": [""]
19 });
20 testParse("x=42&y=42&x=37&y=37", {
21 "x": ["42", "37"],
22 "y": ["42", "37"]
23 });
24 testParse("x&x&x&x&x", {
25 "x": ["", "", "", "", ""]
26 });
27 testParse("x=&&y", {
28 "x": [""],
29 "y": [""]
30 });
31 }
32
33 testAll(List values) {
34 var uri =
35 new Uri(scheme: "foo", path: "bar", queryParameters: {"baz": values});
36 var list = uri.queryParametersAll["baz"];
37 Expect.listEquals(values, list);
38 }
39
40 testParse(query, results) {
41 var uri = new Uri(scheme: "foo", path: "bar", query: query);
42 var params = uri.queryParametersAll;
43 for (var k in results.keys) {
44 Expect.listEquals(results[k], params[k]);
45 }
46 uri = new Uri(scheme: "foo", path: "bar", queryParameters: results);
47 params = uri.queryParametersAll;
48 for (var k in results.keys) {
49 Expect.listEquals(results[k], params[k]);
50 }
51 }
OLDNEW
« no previous file with comments | « tests/corelib_strong/uri_normalize_test.dart ('k') | tests/corelib_strong/uri_parse_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698