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

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

Issue 14619008: Add static getters for common internet addresses (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6
7 import "package:expect/expect.dart";
8
9 void test() {
10 var loopback4 = InternetAddress.LOOPBACK_IP_V4;
11 Expect.isNotNull(loopback4);
12 Expect.equals(InternetAddressType.IP_V4, loopback4.type);
13 Expect.equals("localhost", loopback4.host);
14 Expect.equals("127.0.0.1", loopback4.address);
Bill Hesse 2013/04/30 10:50:22 There is something wrong with the fact that we can
Søren Gjesse 2013/04/30 11:28:41 Yes, that's true. The content of _sockaddr_storage
15
16 var loopback6 = InternetAddress.LOOPBACK_IP_V6;
17 Expect.isNotNull(loopback6);
18 Expect.equals(InternetAddressType.IP_V6, loopback6.type);
19 Expect.equals("ip6-localhost", loopback6.host);
20 Expect.equals("::1", loopback6.address);
21
22 var any4 = InternetAddress.ANY_IP_V4;
23 Expect.isNotNull(any4);
24 Expect.equals(InternetAddressType.IP_V4, any4.type);
25 Expect.equals("0.0.0.0", any4.host);
26 Expect.equals("0.0.0.0", any4.address);
27
28 var any6 = InternetAddress.ANY_IP_V6;
29 Expect.isNotNull(any6);
30 Expect.equals(InternetAddressType.IP_V6, any6.type);
31 Expect.equals("::", any6.host);
32 Expect.equals("::", any6.address);
33 }
34
35 void main() {
36 test();
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698