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

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

Issue 23766030: Return the correct port from Uri, when port is 0 and scheme is either http or https. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tests and check for first charecter is alphabetic in scheme. Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tests/corelib/uri_ipv6_test.dart ('k') | tests/corelib/uri_scheme_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
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
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
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 }
OLDNEW
« no previous file with comments | « tests/corelib/uri_ipv6_test.dart ('k') | tests/corelib/uri_scheme_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698