| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:collection"; | 5 import "dart:collection"; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 | 8 |
| 9 void testInvalidArguments() { | 9 void testInvalidArguments() { |
| 10 } | 10 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void testPathSegments() { | 40 void testPathSegments() { |
| 41 void test(String path, List<String> segments) { | 41 void test(String path, List<String> segments) { |
| 42 void check(uri) { | 42 void check(uri) { |
| 43 Expect.equals(path, uri.path); | 43 Expect.equals(path, uri.path); |
| 44 Expect.equals(path, uri.toString()); | 44 Expect.equals(path, uri.toString()); |
| 45 Expect.listEquals(segments, uri.pathSegments); | 45 Expect.listEquals(segments, uri.pathSegments); |
| 46 } | 46 } |
| 47 | 47 |
| 48 var uri1 = new Uri(pathSegments: segments); | 48 var uri1 = new Uri(pathSegments: segments); |
| 49 var uri2 = new Uri(path: path); | 49 var uri2 = new Uri(path: path); |
| 50 var uri3 = Uri.parse(path); | |
| 51 check(uri1); | 50 check(uri1); |
| 52 check(uri2); | 51 check(uri2); |
| 53 check(uri3); | 52 Expect.equals(uri1, uri2); |
| 54 Expect.equals(uri1, uri3); | |
| 55 Expect.equals(uri2, uri3); | |
| 56 } | 53 } |
| 57 | 54 |
| 58 test("", []); | 55 test("", []); |
| 59 test("%20", [" "]); | 56 test("%20", [" "]); |
| 60 test("%20/%20%20", [" ", " "]); | 57 test("%20/%20%20", [" ", " "]); |
| 61 test("A", ["A"]); | 58 test("A", ["A"]); |
| 62 test("%C3%B8", ["ø"]); | 59 test("%C3%B8", ["ø"]); |
| 63 test("%C3%B8/%C3%A5", ["ø", "å"]); | 60 test("%C3%B8/%C3%A5", ["ø", "å"]); |
| 64 test("%C8%A4/%E5%B9%B3%E4%BB%AE%E5%90%8D", ["Ȥ", "平仮名"]); | 61 test("%C8%A4/%E5%B9%B3%E4%BB%AE%E5%90%8D", ["Ȥ", "平仮名"]); |
| 65 test("A/b", ["A", "b"]); | 62 test("A/b", ["A", "b"]); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 test(new Uri(pathSegments: ["a", "b"]).pathSegments); | 182 test(new Uri(pathSegments: ["a", "b"]).pathSegments); |
| 186 } | 183 } |
| 187 | 184 |
| 188 main() { | 185 main() { |
| 189 testInvalidArguments(); | 186 testInvalidArguments(); |
| 190 testPath(); | 187 testPath(); |
| 191 testPathSegments(); | 188 testPathSegments(); |
| 192 testPathCompare(); | 189 testPathCompare(); |
| 193 testPathSegmentsUnmodifiableList(); | 190 testPathSegmentsUnmodifiableList(); |
| 194 } | 191 } |
| OLD | NEW |