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

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

Issue 17640008: Add reverse dns lookup as a method on InternetAddress. (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 | « sdk/lib/io/socket.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) 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 14 matching lines...) Expand all
25 Expect.equals("0.0.0.0", any4.host); 25 Expect.equals("0.0.0.0", any4.host);
26 Expect.equals("0.0.0.0", any4.address); 26 Expect.equals("0.0.0.0", any4.address);
27 27
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() {
36 InternetAddress.lookup('localhost').then((addrs) {
37 addrs.first.reverse().then((addr) {
38 Expect.equals('localhost', addr.host);
39 });
40 });
41
42 InternetAddress.lookup('127.0.0.1').then((addrs) {
43 addrs.first.reverse().then((addr) {
44 Expect.equals('localhost', addr.host);
45 });
46 });
47 }
48
35 void main() { 49 void main() {
36 testDefaultAddresses(); 50 testDefaultAddresses();
51 testReverseLookup();
37 } 52 }
OLDNEW
« 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