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"; | |
6 | |
7 class C<T> {} | 5 class C<T> {} |
8 | 6 |
9 sameType(a, b) { | 7 sameType(a, b) { |
10 Expect.equals(a.runtimeType, b.runtimeType); | 8 Expect.equals(a.runtimeType, b.runtimeType); |
11 } | 9 } |
12 | 10 |
13 differentType(a, b) { | 11 differentType(a, b) { |
14 Expect.isFalse(a.runtimeType == b.runtimeType); | 12 Expect.isFalse(a.runtimeType == b.runtimeType); |
15 } | 13 } |
16 | 14 |
(...skipping 18 matching lines...) Expand all Loading... |
35 var l = [1, 2, 3]; | 33 var l = [1, 2, 3]; |
36 var m = {'a': 1, 'b': 2}; | 34 var m = {'a': 1, 'b': 2}; |
37 sameType([], l); | 35 sameType([], l); |
38 sameType({}, m); | 36 sameType({}, m); |
39 | 37 |
40 // Test parameterized lists. | 38 // Test parameterized lists. |
41 sameType(new List<int>(), new List<int>()); | 39 sameType(new List<int>(), new List<int>()); |
42 differentType(new List<int>(), new List<num>()); | 40 differentType(new List<int>(), new List<num>()); |
43 differentType(new List<int>(), new List()); | 41 differentType(new List<int>(), new List()); |
44 } | 42 } |
OLD | NEW |