OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 main() { | 7 main() { |
8 List<int> list1 = <int>[1, 2, 3]; | 8 List<int> list1 = <int>[1, 2, 3]; |
9 List<int> list2 = const <int>[4, 4]; | 9 List<int> list2 = const <int>[4, 4]; |
10 List<String> list3 = <String>[]; | 10 List<String> list3 = <String>[]; |
(...skipping 10 matching lines...) Expand all Loading... |
21 Expect.isTrue(setCopy.contains(3)); | 21 Expect.isTrue(setCopy.contains(3)); |
22 Expect.isTrue(setCopy is Set<int>); | 22 Expect.isTrue(setCopy is Set<int>); |
23 Expect.isFalse(setCopy is Set<String>); | 23 Expect.isFalse(setCopy is Set<String>); |
24 | 24 |
25 setCopy = list2.toSet(); | 25 setCopy = list2.toSet(); |
26 Expect.equals(1, setCopy.length); | 26 Expect.equals(1, setCopy.length); |
27 Expect.isTrue(setCopy.contains(4)); | 27 Expect.isTrue(setCopy.contains(4)); |
28 Expect.isTrue(setCopy is Set<int>); | 28 Expect.isTrue(setCopy is Set<int>); |
29 Expect.isFalse(setCopy is Set<String>); | 29 Expect.isFalse(setCopy is Set<String>); |
30 | 30 |
31 setCopy = list3.toSet(); | 31 var setStrCopy = list3.toSet(); |
32 Expect.isTrue(setCopy.isEmpty); | 32 Expect.isTrue(setStrCopy.isEmpty); |
33 Expect.isTrue(setCopy is Set<String>); | 33 Expect.isTrue(setStrCopy is Set<String>); |
34 Expect.isFalse(setCopy is Set<int>); | 34 Expect.isFalse(setStrCopy is Set<int>); |
35 | 35 |
36 setCopy = set1.toSet(); | 36 setCopy = set1.toSet(); |
37 Expect.setEquals(set1, setCopy); | 37 Expect.setEquals(set1, setCopy); |
38 Expect.isTrue(setCopy is Set<int>); | 38 Expect.isTrue(setCopy is Set<int>); |
39 Expect.isFalse(setCopy is Set<String>); | 39 Expect.isFalse(setCopy is Set<String>); |
40 Expect.isFalse(identical(setCopy, set1)); | 40 Expect.isFalse(identical(setCopy, set1)); |
41 | 41 |
42 setCopy = set2.toSet(); | 42 setStrCopy = set2.toSet(); |
43 Expect.setEquals(set2, setCopy); | 43 Expect.setEquals(set2, setStrCopy); |
44 Expect.isTrue(setCopy is Set<String>); | 44 Expect.isTrue(setStrCopy is Set<String>); |
45 Expect.isFalse(setCopy is Set<int>); | 45 Expect.isFalse(setStrCopy is Set<int>); |
46 Expect.isFalse(identical(setCopy, set2)); | 46 Expect.isFalse(identical(setStrCopy, set2)); |
47 | 47 |
48 setCopy = set3.toSet(); | 48 setCopy = set3.toSet(); |
49 Expect.setEquals(set3, setCopy); | 49 Expect.setEquals(set3, setCopy); |
50 Expect.isTrue(setCopy is Set<String>); | 50 Expect.isTrue(setCopy is Set<String>); |
51 Expect.isTrue(setCopy is Set<int>); | 51 Expect.isTrue(setCopy is Set<int>); |
52 Expect.isFalse(identical(setCopy, set3)); | 52 Expect.isFalse(identical(setCopy, set3)); |
53 } | 53 } |
OLD | NEW |