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 // Test number types. | 4 // Test number types. |
5 | 5 |
6 library NumbersTest.dart; | 6 library NumbersTest.dart; |
| 7 import "package:expect/expect.dart"; |
7 | 8 |
8 class NumbersTest { | 9 class NumbersTest { |
9 static double testMain() { | 10 static double testMain() { |
10 var one = 1; | 11 var one = 1; |
11 Expect.equals(true, one is Object); | 12 Expect.equals(true, one is Object); |
12 Expect.equals(true, one is num); | 13 Expect.equals(true, one is num); |
13 Expect.equals(true, one is int); | 14 Expect.equals(true, one is int); |
14 Expect.equals(false, one is double); | 15 Expect.equals(false, one is double); |
15 | 16 |
16 var two = 2.0; | 17 var two = 2.0; |
(...skipping 10 matching lines...) Expand all Loading... |
27 | 28 |
28 Expect.equals(3.0, result); | 29 Expect.equals(3.0, result); |
29 return result; | 30 return result; |
30 } | 31 } |
31 } | 32 } |
32 | 33 |
33 | 34 |
34 main() { | 35 main() { |
35 NumbersTest.testMain(); | 36 NumbersTest.testMain(); |
36 } | 37 } |
OLD | NEW |