OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 import "package:expect/expect.dart"; | |
6 | |
7 // Tests for the contains methods on lists. | |
8 | |
9 class A { | |
10 const A(); | |
11 } | |
12 | |
13 class B extends A { | |
14 const B(); | |
15 } | |
16 | |
17 main() { | |
18 var list = <B>[new B()]; | |
19 var set = new Set<B>(); | |
20 set.add(new B()); | |
21 var iterable1 = list.map((x) => x); | |
22 var iterable2 = list.take(1); | |
23 var list2 = const <B>[const B()]; | |
24 var iterable3 = list2.map((x) => x); | |
25 var iterable4 = list2.take(1); | |
26 var iterables = [ | |
27 list, | |
28 set, | |
29 iterable1, | |
30 iterable2, | |
31 list2, | |
32 iterable3, | |
33 iterable4 | |
34 ]; | |
35 for (var iterable in iterables) { | |
36 Expect.isFalse(iterable.contains(new A())); | |
37 } | |
38 } | |
OLD | NEW |