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 |
5 class BaseClass { | 7 class BaseClass { |
6 var foo; | 8 var foo; |
7 BaseClass() { foo = 0; } | 9 BaseClass() { foo = 0; } |
8 toString() => "BaseClass"; | 10 toString() => "BaseClass"; |
9 } | 11 } |
10 | 12 |
11 /** | 13 /** |
12 * This class declaration causes an intentional type warning as it | 14 * This class declaration causes an intentional type warning as it |
13 * isn't marked abstract. It is abstract because it doesn't | 15 * isn't marked abstract. It is abstract because it doesn't |
14 * "implement" the field foo. | 16 * "implement" the field foo. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 Expect.equals(true, c1 is !ExtendsClass); | 49 Expect.equals(true, c1 is !ExtendsClass); |
48 Expect.equals(true, c2 is BaseClass); | 50 Expect.equals(true, c2 is BaseClass); |
49 Expect.equals(true, c2 is ExtendsClass); | 51 Expect.equals(true, c2 is ExtendsClass); |
50 Expect.equals(true, c2 is !ImplementsClass); | 52 Expect.equals(true, c2 is !ImplementsClass); |
51 Expect.equals("BaseClass", "${new BaseClass()}"); | 53 Expect.equals("BaseClass", "${new BaseClass()}"); |
52 | 54 |
53 // Verify we don't inherit toString from BaseClass | 55 // Verify we don't inherit toString from BaseClass |
54 Expect.notEquals("BaseClass", "${c1}"); | 56 Expect.notEquals("BaseClass", "${c1}"); |
55 Expect.notEquals("BaseClass", "${c2}"); | 57 Expect.notEquals("BaseClass", "${c2}"); |
56 } | 58 } |
OLD | NEW |