| OLD | NEW |
| 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 | 9 |
| 10 void testListLoopback() { | 10 void testListLoopback() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 NetworkInterface.list(includeLinkLocal: false).then((list) { | 26 NetworkInterface.list(includeLinkLocal: false).then((list) { |
| 27 for (var i in list) { | 27 for (var i in list) { |
| 28 for (var a in i.addresses) { | 28 for (var a in i.addresses) { |
| 29 Expect.isFalse(a.isLinkLocal); | 29 Expect.isFalse(a.isLinkLocal); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 }); | 32 }); |
| 33 } | 33 } |
| 34 | 34 |
| 35 | 35 |
| 36 void testListIndex() { |
| 37 var set = new Set(); |
| 38 NetworkInterface.list(includeLoopback: true).then((list) { |
| 39 for (var i in list) { |
| 40 Expect.isNotNull(i.index); |
| 41 Expect.isFalse(set.contains(i.index)); |
| 42 set.add(i.index); |
| 43 Expect.isTrue(set.contains(i.index)); |
| 44 } |
| 45 }); |
| 46 } |
| 47 |
| 48 |
| 36 void main() { | 49 void main() { |
| 37 testListLoopback(); | 50 testListLoopback(); |
| 38 testListLinkLocal(); | 51 testListLinkLocal(); |
| 52 testListIndex(); |
| 39 } | 53 } |
| OLD | NEW |