| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "dart:async"; |
| 5 import "dart:utf"; | 6 import "dart:utf"; |
| 6 part "../../../sdk/lib/io/input_stream.dart"; | 7 part "../../../sdk/lib/io/input_stream.dart"; |
| 7 part "../../../sdk/lib/io/output_stream.dart"; | 8 part "../../../sdk/lib/io/output_stream.dart"; |
| 8 part "../../../sdk/lib/io/chunked_stream.dart"; | 9 part "../../../sdk/lib/io/chunked_stream.dart"; |
| 9 part "../../../sdk/lib/io/string_stream.dart"; | 10 part "../../../sdk/lib/io/string_stream.dart"; |
| 10 part "../../../sdk/lib/io/stream_util.dart"; | 11 part "../../../sdk/lib/io/stream_util.dart"; |
| 11 part "../../../sdk/lib/io/http.dart"; | 12 part "../../../sdk/lib/io/http.dart"; |
| 12 part "../../../sdk/lib/io/http_impl.dart"; | 13 part "../../../sdk/lib/io/http_impl.dart"; |
| 13 part "../../../sdk/lib/io/http_parser.dart"; | 14 part "../../../sdk/lib/io/http_parser.dart"; |
| 14 part "../../../sdk/lib/io/http_utils.dart"; | 15 part "../../../sdk/lib/io/http_utils.dart"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 28 String queryString = | 29 String queryString = |
| 29 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek'; | 30 '%3F=%3D&foo=bar&%26=%25&sqrt2=%E2%88%9A2&name=Franti%C5%A1ek'; |
| 30 Map<String, String> map = _HttpUtils.splitQueryString(queryString); | 31 Map<String, String> map = _HttpUtils.splitQueryString(queryString); |
| 31 for (String key in map.keys) { | 32 for (String key in map.keys) { |
| 32 Expect.equals(map[key], { '&' : '%', | 33 Expect.equals(map[key], { '&' : '%', |
| 33 'foo' : 'bar', | 34 'foo' : 'bar', |
| 34 '?' : '=', | 35 '?' : '=', |
| 35 'sqrt2' : '\u221A2', | 36 'sqrt2' : '\u221A2', |
| 36 'name' : 'Franti\u0161ek'}[key]); | 37 'name' : 'Franti\u0161ek'}[key]); |
| 37 } | 38 } |
| 38 Expect.setEquals(map.keys, ['&', '?', 'foo', 'sqrt2', 'name']); | 39 Expect.setEquals(map.keys.toSet(), ['&', '?', 'foo', 'sqrt2', 'name']); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void main() { | 42 void main() { |
| 42 testParseEncodedString(); | 43 testParseEncodedString(); |
| 43 testParseQueryString(); | 44 testParseQueryString(); |
| 44 } | 45 } |
| OLD | NEW |