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