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