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

Side by Side Diff: tests/corelib_2/uri_path_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_2/uri_parse_test.dart ('k') | tests/corelib_2/uri_query_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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 var unencoded = new StringBuffer(); 76 var unencoded = new StringBuffer();
77 for (int i = 32; i < 128; i++) { 77 for (int i = 32; i < 128; i++) {
78 if (pchar.indexOf(new String.fromCharCode(i)) != -1) { 78 if (pchar.indexOf(new String.fromCharCode(i)) != -1) {
79 encoded.writeCharCode(i); 79 encoded.writeCharCode(i);
80 } else { 80 } else {
81 encoded.write("%"); 81 encoded.write("%");
82 encoded.write(i.toRadixString(16).toUpperCase()); 82 encoded.write(i.toRadixString(16).toUpperCase());
83 } 83 }
84 unencoded.writeCharCode(i); 84 unencoded.writeCharCode(i);
85 } 85 }
86 encoded = encoded.toString(); 86 var encodedStr = encoded.toString();
87 unencoded = unencoded.toString(); 87 var unencodedStr = unencoded.toString();
88 test(encoded, [unencoded]); 88 test(encodedStr, [unencodedStr]);
89 test(encoded + "/" + encoded, [unencoded, unencoded]); 89 test(encodedStr + "/" + encodedStr, [unencodedStr, unencodedStr]);
90 90
91 Uri uri; 91 Uri uri;
92 List pathSegments = ["xxx", "yyy", "zzz"]; 92 var pathSegments = ["xxx", "yyy", "zzz"];
93 93
94 uri = new Uri(pathSegments: pathSegments); 94 uri = new Uri(pathSegments: pathSegments);
95 Expect.equals(3, uri.pathSegments.length); 95 Expect.equals(3, uri.pathSegments.length);
96 uri = new Uri(pathSegments: pathSegments.where((_) => true)); 96 uri = new Uri(pathSegments: pathSegments.where((_) => true));
97 Expect.equals(3, uri.pathSegments.length); 97 Expect.equals(3, uri.pathSegments.length);
98 uri = new Uri(pathSegments: new DoubleLinkedQueue.from(pathSegments)); 98 uri = new Uri(pathSegments: new DoubleLinkedQueue.from(pathSegments));
99 Expect.equals(3, uri.pathSegments.length); 99 Expect.equals(3, uri.pathSegments.length);
100 100
101 uri = new Uri(scheme: "http", host: "host", pathSegments: pathSegments); 101 uri = new Uri(scheme: "http", host: "host", pathSegments: pathSegments);
102 Expect.equals(3, uri.pathSegments.length); 102 Expect.equals(3, uri.pathSegments.length);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 test(new Uri(pathSegments: ["a", "b"]).pathSegments); 179 test(new Uri(pathSegments: ["a", "b"]).pathSegments);
180 } 180 }
181 181
182 main() { 182 main() {
183 testInvalidArguments(); 183 testInvalidArguments();
184 testPath(); 184 testPath();
185 testPathSegments(); 185 testPathSegments();
186 testPathCompare(); 186 testPathCompare();
187 testPathSegmentsUnmodifiableList(); 187 testPathSegmentsUnmodifiableList();
188 } 188 }
OLDNEW
« no previous file with comments | « tests/corelib_2/uri_parse_test.dart ('k') | tests/corelib_2/uri_query_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698