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

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

Issue 354003002: Also fix uri_query_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: And uri_test too. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tests/corelib/uri_query_test.dart ('k') | no next file » | 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) 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 library uriTest; 5 library uriTest;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 testUri(String uri, bool isAbsolute) { 10 testUri(String uri, bool isAbsolute) {
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 uri = new Uri(scheme: "file", path: "y"); 353 uri = new Uri(scheme: "file", path: "y");
354 Expect.equals("file:///y", uri.toString()); 354 Expect.equals("file:///y", uri.toString());
355 355
356 // Empty host/query/fragment ensures the delimiter is there. 356 // Empty host/query/fragment ensures the delimiter is there.
357 // Different from not being there. 357 // Different from not being there.
358 Expect.equals("scheme:/", Uri.parse("scheme:/").toString()); 358 Expect.equals("scheme:/", Uri.parse("scheme:/").toString());
359 Expect.equals("scheme:/", 359 Expect.equals("scheme:/",
360 new Uri(scheme: "scheme", path: "/").toString()); 360 new Uri(scheme: "scheme", path: "/").toString());
361 361
362 Expect.equals("scheme:///?#", Uri.parse("scheme:///?#").toString()); 362 Expect.equals("scheme:///?#", Uri.parse("scheme:///?#").toString());
363 Expect.equals("scheme:///?#", 363 Expect.equals("scheme:///#",
364 new Uri(scheme: "scheme", host: "", path: "/", 364 new Uri(scheme: "scheme", host: "", path: "/",
365 query: "", fragment: "").toString()); 365 query: "", fragment: "").toString());
366 } 366 }
367 367
368 main() { 368 main() {
369 testUri("http:", true); 369 testUri("http:", true);
370 testUri("file://", true); 370 testUri("file://", true);
371 testUri("file", false); 371 testUri("file", false);
372 testUri("http://user@example.com:8080/fisk?query=89&hest=silas", true); 372 testUri("http://user@example.com:8080/fisk?query=89&hest=silas", true);
373 testUri("http://user@example.com:8080/fisk?query=89&hest=silas#fragment", 373 testUri("http://user@example.com:8080/fisk?query=89&hest=silas#fragment",
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 String dump(Uri uri) { 534 String dump(Uri uri) {
535 return "URI: $uri\n" 535 return "URI: $uri\n"
536 " Scheme: ${uri.scheme} #${uri.scheme.length}\n" 536 " Scheme: ${uri.scheme} #${uri.scheme.length}\n"
537 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n" 537 " User-info: ${uri.userInfo} #${uri.userInfo.length}\n"
538 " Host: ${uri.host} #${uri.host.length}\n" 538 " Host: ${uri.host} #${uri.host.length}\n"
539 " Port: ${uri.port}\n" 539 " Port: ${uri.port}\n"
540 " Path: ${uri.path} #${uri.path.length}\n" 540 " Path: ${uri.path} #${uri.path.length}\n"
541 " Query: ${uri.query} #${uri.query.length}\n" 541 " Query: ${uri.query} #${uri.query.length}\n"
542 " Fragment: ${uri.fragment} #${uri.fragment.length}\n"; 542 " Fragment: ${uri.fragment} #${uri.fragment.length}\n";
543 } 543 }
OLDNEW
« no previous file with comments | « tests/corelib/uri_query_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698