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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
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
10 void testListLoopback() { 9 void testListLoopback() {
11 NetworkInterface.list(includeLoopback: false).then((list) { 10 NetworkInterface.list(includeLoopback: false).then((list) {
12 for (var i in list) { 11 for (var i in list) {
13 for (var a in i.addresses) { 12 for (var a in i.addresses) {
14 Expect.isFalse(a.isLoopback); 13 Expect.isFalse(a.isLoopback);
15 } 14 }
16 } 15 }
17 }); 16 });
18 17
19 NetworkInterface.list(includeLoopback: true).then((list) { 18 NetworkInterface.list(includeLoopback: true).then((list) {
20 Expect.isTrue(list.any((i) => i.addresses.any((a) => a.isLoopback))); 19 Expect.isTrue(list.any((i) => i.addresses.any((a) => a.isLoopback)));
21 }); 20 });
22 } 21 }
23 22
24
25 void testListLinkLocal() { 23 void testListLinkLocal() {
26 NetworkInterface.list(includeLinkLocal: false).then((list) { 24 NetworkInterface.list(includeLinkLocal: false).then((list) {
27 for (var i in list) { 25 for (var i in list) {
28 for (var a in i.addresses) { 26 for (var a in i.addresses) {
29 Expect.isFalse(a.isLinkLocal); 27 Expect.isFalse(a.isLinkLocal);
30 } 28 }
31 } 29 }
32 }); 30 });
33 } 31 }
34 32
35
36 void testListIndex() { 33 void testListIndex() {
37 var set = new Set(); 34 var set = new Set();
38 NetworkInterface.list(includeLoopback: true).then((list) { 35 NetworkInterface.list(includeLoopback: true).then((list) {
39 for (var i in list) { 36 for (var i in list) {
40 Expect.isNotNull(i.index); 37 Expect.isNotNull(i.index);
41 Expect.isFalse(set.contains(i.index)); 38 Expect.isFalse(set.contains(i.index));
42 set.add(i.index); 39 set.add(i.index);
43 Expect.isTrue(set.contains(i.index)); 40 Expect.isTrue(set.contains(i.index));
44 } 41 }
45 }); 42 });
46 } 43 }
47 44
48
49 void main() { 45 void main() {
50 if (!NetworkInterface.listSupported) { 46 if (!NetworkInterface.listSupported) {
51 return; 47 return;
52 } 48 }
53 testListLoopback(); 49 testListLoopback();
54 testListLinkLocal(); 50 testListLinkLocal();
55 testListIndex(); 51 testListIndex();
56 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698