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"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 main() { | 7 main() { |
8 // Integer literals. | 8 // Integer literals. |
9 Expect.isTrue(2is int); | 9 Expect.isTrue(2is int); |
10 Expect.equals(2, 2as int); | 10 Expect.equals(2, 2as int); |
(...skipping 13 matching lines...) Expand all Loading... |
24 Expect.isTrue(.2is double); | 24 Expect.isTrue(.2is double); |
25 Expect.equals(0.2, .2as double); | 25 Expect.equals(0.2, .2as double); |
26 Expect.isTrue(1e2is double); | 26 Expect.isTrue(1e2is double); |
27 Expect.equals(1e2, 1e2as double); | 27 Expect.equals(1e2, 1e2as double); |
28 Expect.isTrue(1e-2is double); | 28 Expect.isTrue(1e-2is double); |
29 Expect.equals(1e-2, 1e-2as double); | 29 Expect.equals(1e-2, 1e-2as double); |
30 Expect.isTrue(1e+2is double); | 30 Expect.isTrue(1e+2is double); |
31 Expect.equals(1e+2, 1e+2as double); | 31 Expect.equals(1e+2, 1e+2as double); |
32 Expect.throws(() => 1.e+2, /// 05: ok | 32 Expect.throws(() => 1.e+2, /// 05: ok |
33 (e) => e is NoSuchMethodError); /// 05: continued | 33 (e) => e is NoSuchMethodError); /// 05: continued |
| 34 1d; /// 06: compile-time error |
| 35 1D; /// 07: compile-time error |
| 36 Expect.throws(() => 1.d+2, /// 08: ok |
| 37 (e) => e is NoSuchMethodError); /// 08: continued |
| 38 Expect.throws(() => 1.D+2, /// 09: ok |
| 39 (e) => e is NoSuchMethodError); /// 09: continued |
| 40 1.1d; /// 10: compile-time error |
| 41 1.1D; /// 11: compile-time error |
34 1e; /// 02: compile-time error | 42 1e; /// 02: compile-time error |
35 1x; /// 03: compile-time error | 43 1x; /// 03: compile-time error |
36 } | 44 } |
OLD | NEW |