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

Unified Diff: tests/standalone/io/internet_address_test.dart

Issue 180163005: Add InternetAddress:rawAddress, to return the raw address as a list of bytes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/internet_address_test.dart
diff --git a/tests/standalone/io/internet_address_test.dart b/tests/standalone/io/internet_address_test.dart
index d8a997f897067aa0bbe55d3385e292ecf4691ea3..ea6d0b1040e3ceb7fd7fa1360652ad88c80eea66 100644
--- a/tests/standalone/io/internet_address_test.dart
+++ b/tests/standalone/io/internet_address_test.dart
@@ -12,12 +12,15 @@ void testDefaultAddresses() {
Expect.equals(InternetAddressType.IP_V4, loopback4.type);
Expect.equals("127.0.0.1", loopback4.host);
Expect.equals("127.0.0.1", loopback4.address);
+ Expect.listEquals([127, 0, 0, 1], loopback4.rawAddress);
var loopback6 = InternetAddress.LOOPBACK_IP_V6;
Expect.isNotNull(loopback6);
Expect.equals(InternetAddressType.IP_V6, loopback6.type);
Expect.equals("::1", loopback6.host);
Expect.equals("::1", loopback6.address);
+ Expect.listEquals([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
+ loopback6.rawAddress);
var any4 = InternetAddress.ANY_IP_V4;
Expect.isNotNull(any4);
@@ -118,14 +121,17 @@ void testReverseLookup() {
InternetAddress.lookup('localhost').then((addrs) {
addrs.first.reverse().then((addr) {
Expect.isNotNull(addr.host);
+ Expect.isNotNull(addr.rawAddress);
});
});
InternetAddress.lookup('127.0.0.1').then((addrs) {
Expect.equals('127.0.0.1', addrs.first.host);
+ Expect.listEquals([127, 0, 0, 1], addrs.first.rawAddress);
addrs.first.reverse().then((addr) {
Expect.isNotNull(addr.host);
Expect.notEquals('127.0.0.1', addr.host);
+ Expect.listEquals([127, 0, 0, 1], addr.rawAddress);
});
});
}
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698