Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..67216d4b4555e0d028c7bcab18e07266555f8488 |
| --- /dev/null |
| +++ b/tests/standalone/io/internet_address_test.dart |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import 'dart:io'; |
| + |
| +import "package:expect/expect.dart"; |
| + |
| +void test() { |
| + var loopback4 = InternetAddress.LOOPBACK_IP_V4; |
| + Expect.isNotNull(loopback4); |
| + Expect.equals(InternetAddressType.IP_V4, loopback4.type); |
| + Expect.equals("localhost", loopback4.host); |
| + 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
|
| + |
| + var loopback6 = InternetAddress.LOOPBACK_IP_V6; |
| + Expect.isNotNull(loopback6); |
| + Expect.equals(InternetAddressType.IP_V6, loopback6.type); |
| + Expect.equals("ip6-localhost", loopback6.host); |
| + Expect.equals("::1", loopback6.address); |
| + |
| + var any4 = InternetAddress.ANY_IP_V4; |
| + Expect.isNotNull(any4); |
| + Expect.equals(InternetAddressType.IP_V4, any4.type); |
| + Expect.equals("0.0.0.0", any4.host); |
| + Expect.equals("0.0.0.0", any4.address); |
| + |
| + var any6 = InternetAddress.ANY_IP_V6; |
| + Expect.isNotNull(any6); |
| + Expect.equals(InternetAddressType.IP_V6, any6.type); |
| + Expect.equals("::", any6.host); |
| + Expect.equals("::", any6.address); |
| +} |
| + |
| +void main() { |
| + test(); |
| +} |