| 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 class A { | 7 class A { |
| 8 static var a; | 8 static var a; |
| 9 static var b = c; | 9 static var b = c; |
| 10 static const var c = 499; | 10 static const c = 499; |
| 11 static const var d = c; | 11 static const d = c; |
| 12 static const var e = d; | 12 static const e = d; |
| 13 static const var f = B.g; | 13 static const f = B.g; |
| 14 static const var h = true; | 14 static const h = true; |
| 15 static const var i = false; | 15 static const i = false; |
| 16 static const var j = n; | 16 static const j = n; |
| 17 static const var k = 4.99; | 17 static const k = 4.99; |
| 18 static const var l; | 18 static const l; |
| 19 static const var m = l; | 19 static const m = l; |
| 20 static const var n = 42; | 20 static const n = 42; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class B { | 23 class B { |
| 24 static const var g = A.c; | 24 static const g = A.c; |
| 25 } | 25 } |
| 26 | 26 |
| 27 testInitialValues() { | 27 testInitialValues() { |
| 28 Expect.equals(null, A.a); | 28 Expect.equals(null, A.a); |
| 29 Expect.equals(499, A.b); | 29 Expect.equals(499, A.b); |
| 30 Expect.equals(499, A.c); | 30 Expect.equals(499, A.c); |
| 31 Expect.equals(499, A.d); | 31 Expect.equals(499, A.d); |
| 32 Expect.equals(499, A.e); | 32 Expect.equals(499, A.e); |
| 33 Expect.equals(499, A.f); | 33 Expect.equals(499, A.f); |
| 34 Expect.equals(499, B.g); | 34 Expect.equals(499, B.g); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 47 A.b = 42; | 47 A.b = 42; |
| 48 Expect.equals(42, A.b); | 48 Expect.equals(42, A.b); |
| 49 Expect.equals(499, A.c); | 49 Expect.equals(499, A.c); |
| 50 Expect.equals(499, A.a); | 50 Expect.equals(499, A.a); |
| 51 } | 51 } |
| 52 | 52 |
| 53 main() { | 53 main() { |
| 54 testInitialValues(); | 54 testInitialValues(); |
| 55 testMutation(); | 55 testMutation(); |
| 56 } | 56 } |
| OLD | NEW |