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

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

Issue 16108003: Avoid parsing path and query string more than once (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 void testInvalidArguments() { 7 void testInvalidArguments() {
8 } 8 }
9 9
10 void testPath() { 10 void testPath() {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 unencoded.writeCharCode(i); 69 unencoded.writeCharCode(i);
70 } 70 }
71 encoded = encoded.toString(); 71 encoded = encoded.toString();
72 unencoded = unencoded.toString(); 72 unencoded = unencoded.toString();
73 print(encoded); 73 print(encoded);
74 print(unencoded); 74 print(unencoded);
75 test(encoded, [unencoded]); 75 test(encoded, [unencoded]);
76 test(encoded + "/" + encoded, [unencoded, unencoded]); 76 test(encoded + "/" + encoded, [unencoded, unencoded]);
77 } 77 }
78 78
79 testPathSegmentsParsedOnce() {
80 var uri = Uri.parse("a/b");
81 Expect.isTrue(identical(uri.pathSegments, uri.pathSegments));
Lasse Reichstein Nielsen 2013/05/30 11:57:50 I wouldn't guarantee that - it means you can't thr
Søren Gjesse 2013/05/30 13:38:25 You are probably right. I put it in to make sure m
82
83 var list = ["a", "b"];
84 uri = new Uri(pathSegments: list);
85 Expect.isFalse(identical(list, uri.pathSegments));
86 Expect.isTrue(identical(uri.pathSegments, uri.pathSegments));
87 }
88
79 main() { 89 main() {
80 testInvalidArguments(); 90 testInvalidArguments();
81 testPath(); 91 testPath();
82 testPathSegments(); 92 testPathSegments();
93 testPathSegmentsParsedOnce();
83 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698