OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 class A { | |
6 static var a; | |
7 static var b = c; | |
8 static final var c = 499; | |
9 static final var d = c; | |
10 static final var e = d; | |
11 static final var f = B.g; | |
12 static final var h = true; | |
13 static final var i = false; | |
14 static final var j = n; | |
15 static final var k = 4.99; | |
16 static final var l; | |
17 static final var m = l; | |
18 static final var n = 42; | |
19 } | |
20 | |
21 class B { | |
22 static final var g = A.c; | |
23 } | |
24 | |
25 testInitialValues() { | |
26 Expect.equals(null, A.a); | |
27 Expect.equals(499, A.b); | |
28 Expect.equals(499, A.c); | |
29 Expect.equals(499, A.d); | |
30 Expect.equals(499, A.e); | |
31 Expect.equals(499, A.f); | |
32 Expect.equals(499, B.g); | |
33 Expect.equals(true, A.h); | |
34 Expect.equals(false, A.i); | |
35 Expect.equals(42, A.j); | |
36 Expect.equals(4.99, A.k); | |
37 Expect.equals(null, A.l); | |
38 Expect.equals(null, A.m); | |
39 Expect.equals(42, A.n); | |
40 } | |
41 | |
42 testMutation() { | |
43 A.a = 499; | |
44 Expect.equals(499, A.a); | |
45 A.b = 42; | |
46 Expect.equals(42, A.b); | |
47 Expect.equals(499, A.c); | |
48 Expect.equals(499, A.a); | |
49 } | |
50 | |
51 main() { | |
52 testInitialValues(); | |
53 testMutation(); | |
54 } | |
OLD | NEW |