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 // All things regarding compile time constant expressions. | 4 // All things regarding compile time constant expressions. |
5 | 5 |
6 import "package:expect/expect.dart"; | |
7 | |
8 abstract class Roman { | 6 abstract class Roman { |
9 static const I = 1; | 7 static const I = 1; |
10 static const II = 2; | 8 static const II = 2; |
11 static const III = 3; | 9 static const III = 3; |
12 static const IV = 4; | 10 static const IV = 4; |
13 static const V = 5; | 11 static const V = 5; |
14 | 12 |
15 static const VivaItalia = const {"green": 1, "red": 3, "white": 2}; | 13 static const VivaItalia = const {"green": 1, "red": 3, "white": 2}; |
16 } | 14 } |
17 | 15 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 Expect.equals(true, caughtException); | 114 Expect.equals(true, caughtException); |
117 Expect.equals(1, c11dItaly["green"]); | 115 Expect.equals(1, c11dItaly["green"]); |
118 | 116 |
119 Expect.equals(true, null == naught); | 117 Expect.equals(true, null == naught); |
120 } | 118 } |
121 } | 119 } |
122 | 120 |
123 main() { | 121 main() { |
124 CTConstTest.testMain(); | 122 CTConstTest.testMain(); |
125 } | 123 } |
OLD | NEW |