| OLD | NEW |
| (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 |
| 10 void testListLoopback() { |
| 11 NetworkInterface.list(includeLoopback: false).then((list) { |
| 12 for (var i in list) { |
| 13 for (var a in i.addresses) { |
| 14 Expect.isFalse(a.isLoopback); |
| 15 } |
| 16 } |
| 17 }); |
| 18 |
| 19 NetworkInterface.list(includeLoopback: true).then((list) { |
| 20 Expect.isTrue(list.any((i) => i.addresses.any((a) => a.isLoopback))); |
| 21 }); |
| 22 } |
| 23 |
| 24 |
| 25 void testListLinkLocal() { |
| 26 NetworkInterface.list(includeLinkLocal: false).then((list) { |
| 27 for (var i in list) { |
| 28 for (var a in i.addresses) { |
| 29 Expect.isFalse(a.isLinkLocal); |
| 30 } |
| 31 } |
| 32 }); |
| 33 } |
| 34 |
| 35 |
| 36 void main() { |
| 37 testListLoopback(); |
| 38 testListLinkLocal(); |
| 39 } |
| OLD | NEW |