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

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

Issue 107113007: Fix checked mode errors in InternetAddress test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed analyzer expectation Created 7 years 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
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 testIllegalArguments() {
10 var args = [
11 null, 1, 1.1, new Object(), [], {'a' : '127.0.0.1'},
12 "", "." , ":", ":::"];
13 args.forEach((arg) {
14 Expect.throws(() => new InternetAddress(arg),
15 (e) => e is ArgumentError);
16 });
17 }
18
19 void testDefaultAddresses() { 9 void testDefaultAddresses() {
20 var loopback4 = InternetAddress.LOOPBACK_IP_V4; 10 var loopback4 = InternetAddress.LOOPBACK_IP_V4;
21 Expect.isNotNull(loopback4); 11 Expect.isNotNull(loopback4);
22 Expect.equals(InternetAddressType.IP_V4, loopback4.type); 12 Expect.equals(InternetAddressType.IP_V4, loopback4.type);
23 Expect.equals("127.0.0.1", loopback4.host); 13 Expect.equals("127.0.0.1", loopback4.host);
24 Expect.equals("127.0.0.1", loopback4.address); 14 Expect.equals("127.0.0.1", loopback4.address);
25 15
26 var loopback6 = InternetAddress.LOOPBACK_IP_V6; 16 var loopback6 = InternetAddress.LOOPBACK_IP_V6;
27 Expect.isNotNull(loopback6); 17 Expect.isNotNull(loopback6);
28 Expect.equals(InternetAddressType.IP_V6, loopback6.type); 18 Expect.equals(InternetAddressType.IP_V6, loopback6.type);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 InternetAddress.lookup('127.0.0.1').then((addrs) { 124 InternetAddress.lookup('127.0.0.1').then((addrs) {
135 Expect.equals('127.0.0.1', addrs.first.host); 125 Expect.equals('127.0.0.1', addrs.first.host);
136 addrs.first.reverse().then((addr) { 126 addrs.first.reverse().then((addr) {
137 Expect.isNotNull(addr.host); 127 Expect.isNotNull(addr.host);
138 Expect.notEquals('127.0.0.1', addr.host); 128 Expect.notEquals('127.0.0.1', addr.host);
139 }); 129 });
140 }); 130 });
141 } 131 }
142 132
143 void main() { 133 void main() {
144 testIllegalArguments();
145 testDefaultAddresses(); 134 testDefaultAddresses();
146 testConstructor(); 135 testConstructor();
147 testEquality(); 136 testEquality();
148 testLookup(); 137 testLookup();
149 testReverseLookup(); 138 testReverseLookup();
150 } 139 }
OLDNEW
« no previous file with comments | « tests/standalone/io/internet_address_invalid_arguments_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698