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

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

Issue 1520943002: Support the same parameter key more than once in Uri query parameters. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments. Created 4 years, 11 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
« CHANGELOG.md ('K') | « sdk/lib/core/uri.dart ('k') | no next file » | 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", {"z": ["", ""], "y": [""], "w": [""]});
16 testParse("x=42&y=42&x=37&y=37", {"x": ["42", "37"], "y": ["42", "37"]});
17 testParse("x&x&x&x&x", {"x": ["", "", "", "", ""]});
18 testParse("x=&&y", {"x": [""], "y": [""]});
19 }
20
21 testAll(List values) {
22 var uri = new Uri(scheme: "foo", path: "bar",
23 queryParameters: {"baz": values});
24 var list = uri.queryParametersAll["baz"];
25 Expect.listEquals(values, list);
26 }
27
28 testParse(query, results) {
29 var uri = new Uri(scheme: "foo", path: "bar", query: query);
30 var params = uri.queryParametersAll;
31 for (var k in results.keys) {
32 Expect.listEquals(results[k], params[k]);
33 }
34 uri = new Uri(scheme: "foo", path: "bar", queryParameters: results);
35 params = uri.queryParametersAll;
36 for (var k in results.keys) {
37 Expect.listEquals(results[k], params[k]);
38 }
39 }
OLDNEW
« CHANGELOG.md ('K') | « sdk/lib/core/uri.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698