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

Side by Side Diff: tests/standalone/io/internet_address_test.dart

Issue 17601011: Fix InternetAddress.resolve impl and test for Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « runtime/bin/socket_win.cc ('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) 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:io'; 5 import 'dart:io';
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 void testDefaultAddresses() { 9 void testDefaultAddresses() {
10 var loopback4 = InternetAddress.LOOPBACK_IP_V4; 10 var loopback4 = InternetAddress.LOOPBACK_IP_V4;
(...skipping 17 matching lines...) Expand all
28 var any6 = InternetAddress.ANY_IP_V6; 28 var any6 = InternetAddress.ANY_IP_V6;
29 Expect.isNotNull(any6); 29 Expect.isNotNull(any6);
30 Expect.equals(InternetAddressType.IP_V6, any6.type); 30 Expect.equals(InternetAddressType.IP_V6, any6.type);
31 Expect.equals("::", any6.host); 31 Expect.equals("::", any6.host);
32 Expect.equals("::", any6.address); 32 Expect.equals("::", any6.address);
33 } 33 }
34 34
35 void testReverseLookup() { 35 void testReverseLookup() {
36 InternetAddress.lookup('localhost').then((addrs) { 36 InternetAddress.lookup('localhost').then((addrs) {
37 addrs.first.reverse().then((addr) { 37 addrs.first.reverse().then((addr) {
38 Expect.equals('localhost', addr.host); 38 Expect.isNotNull(addr.host);
39 }); 39 });
40 }); 40 });
41 41
42 InternetAddress.lookup('127.0.0.1').then((addrs) { 42 InternetAddress.lookup('127.0.0.1').then((addrs) {
43 Expect.equals('127.0.0.1', addrs.first.host);
43 addrs.first.reverse().then((addr) { 44 addrs.first.reverse().then((addr) {
44 Expect.equals('localhost', addr.host); 45 Expect.isNotNull(addr.host);
46 Expect.notEquals('127.0.0.1', addr.host);
45 }); 47 });
46 }); 48 });
47 } 49 }
48 50
49 void main() { 51 void main() {
50 testDefaultAddresses(); 52 testDefaultAddresses();
51 testReverseLookup(); 53 testReverseLookup();
52 } 54 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698