| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Tests static and instance fields initialization. | 7 // Tests static and instance fields initialization. |
| 6 class DefaultInitTest { | 8 class DefaultInitTest { |
| 7 static testMain() { | 9 static testMain() { |
| 8 Expect.equals(0, A.a); | 10 Expect.equals(0, A.a); |
| 9 Expect.equals(2, A.b); | 11 Expect.equals(2, A.b); |
| 10 Expect.equals(null, A.c); | 12 Expect.equals(null, A.c); |
| 11 | 13 |
| 12 A a1 = new A(42); | 14 A a1 = new A(42); |
| 13 Expect.equals(42, a1.d); | 15 Expect.equals(42, a1.d); |
| 14 Expect.equals(null, a1.e); | 16 Expect.equals(null, a1.e); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 57 } |
| 56 | 58 |
| 57 class D { | 59 class D { |
| 58 const D(): this.z = 3; | 60 const D(): this.z = 3; |
| 59 final int z; | 61 final int z; |
| 60 } | 62 } |
| 61 | 63 |
| 62 main() { | 64 main() { |
| 63 DefaultInitTest.testMain(); | 65 DefaultInitTest.testMain(); |
| 64 } | 66 } |
| OLD | NEW |