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

Unified Diff: tests/corelib/uri_ipv6_test.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/uri_extras_test.dart ('k') | tests/corelib/uri_normalize_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/uri_ipv6_test.dart
diff --git a/tests/lib/uri/uri_ipv6_test.dart b/tests/corelib/uri_ipv6_test.dart
similarity index 52%
rename from tests/lib/uri/uri_ipv6_test.dart
rename to tests/corelib/uri_ipv6_test.dart
index 1b69cf9d7570458e016d5ad8e38d6b75c277e63a..1ec9d57589776d58c59ef1e3b272ccd03347c0bb 100644
--- a/tests/lib/uri/uri_ipv6_test.dart
+++ b/tests/corelib/uri_ipv6_test.dart
@@ -3,32 +3,49 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:expect/expect.dart';
-import 'dart:uri';
void testValidIpv6Uri() {
var path = 'http://[::1]:1234/path?query=5#now';
var uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('::1', uri.domain);
+ Expect.equals('::1', uri.host);
Expect.equals(1234, uri.port);
Expect.equals('/path', uri.path);
Expect.equals('query=5', uri.query);
Expect.equals('now', uri.fragment);
Expect.equals(path, uri.toString());
- path = 'http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html';
+ path = 'http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:8080/index.html';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', uri.domain);
- Expect.equals(80, uri.port);
+ Expect.equals('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', uri.host);
+ Expect.equals(8080, uri.port);
Expect.equals('/index.html', uri.path);
Expect.equals(path, uri.toString());
+ path = 'http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html';
+ uri = Uri.parse(path);
+ Expect.equals('http', uri.scheme);
+ Expect.equals('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', uri.host);
+ Expect.equals(0, uri.port);
+ Expect.equals('/index.html', uri.path);
+ Expect.equals('http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/index.html',
+ uri.toString());
+
+ path = 'https://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:443/index.html';
+ uri = Uri.parse(path);
+ Expect.equals('https', uri.scheme);
+ Expect.equals('FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', uri.host);
+ Expect.equals(0, uri.port);
+ Expect.equals('/index.html', uri.path);
+ Expect.equals('https://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]/index.html',
+ uri.toString());
+
path = 'http://[1080:0:0:0:8:800:200C:417A]/index.html';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('1080:0:0:0:8:800:200C:417A', uri.domain);
+ Expect.equals('1080:0:0:0:8:800:200C:417A', uri.host);
Expect.equals(0, uri.port);
Expect.equals('/index.html', uri.path);
Expect.equals(path, uri.toString());
@@ -36,7 +53,7 @@ void testValidIpv6Uri() {
path = 'http://[3ffe:2a00:100:7031::1]';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('3ffe:2a00:100:7031::1', uri.domain);
+ Expect.equals('3ffe:2a00:100:7031::1', uri.host);
Expect.equals(0, uri.port);
Expect.equals('', uri.path);
Expect.equals(path, uri.toString());
@@ -44,7 +61,7 @@ void testValidIpv6Uri() {
path = 'http://[1080::8:800:200C:417A]/foo';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('1080::8:800:200C:417A', uri.domain);
+ Expect.equals('1080::8:800:200C:417A', uri.host);
Expect.equals(0, uri.port);
Expect.equals('/foo', uri.path);
Expect.equals(path, uri.toString());
@@ -52,23 +69,39 @@ void testValidIpv6Uri() {
path = 'http://[::192.9.5.5]/ipng';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('::192.9.5.5', uri.domain);
+ Expect.equals('::192.9.5.5', uri.host);
Expect.equals(0, uri.port);
Expect.equals('/ipng', uri.path);
Expect.equals(path, uri.toString());
- path = 'http://[::FFFF:129.144.52.38]:80/index.html';
+ path = 'http://[::FFFF:129.144.52.38]:8080/index.html';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('::FFFF:129.144.52.38', uri.domain);
- Expect.equals(80, uri.port);
+ Expect.equals('::FFFF:129.144.52.38', uri.host);
+ Expect.equals(8080, uri.port);
Expect.equals('/index.html', uri.path);
Expect.equals(path, uri.toString());
+ path = 'http://[::FFFF:129.144.52.38]:80/index.html';
+ uri = Uri.parse(path);
+ Expect.equals('http', uri.scheme);
+ Expect.equals('::FFFF:129.144.52.38', uri.host);
+ Expect.equals(0, uri.port);
+ Expect.equals('/index.html', uri.path);
+ Expect.equals('http://[::FFFF:129.144.52.38]/index.html', uri.toString());
+
+ path = 'https://[::FFFF:129.144.52.38]:443/index.html';
+ uri = Uri.parse(path);
+ Expect.equals('https', uri.scheme);
+ Expect.equals('::FFFF:129.144.52.38', uri.host);
+ Expect.equals(0, uri.port);
+ Expect.equals('/index.html', uri.path);
+ Expect.equals('https://[::FFFF:129.144.52.38]/index.html', uri.toString());
+
path = 'http://[2010:836B:4179::836B:4179]';
uri = Uri.parse(path);
Expect.equals('http', uri.scheme);
- Expect.equals('2010:836B:4179::836B:4179', uri.domain);
+ Expect.equals('2010:836B:4179::836B:4179', uri.host);
Expect.equals(0, uri.port);
Expect.equals('', uri.path);
Expect.equals(path, uri.toString());
« no previous file with comments | « tests/compiler/dart2js/uri_extras_test.dart ('k') | tests/corelib/uri_normalize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698