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 // Testing Bigints. | 4 // Testing Bigints. |
5 // TODO(srdjan): Make sure the numbers are Bigint and not Mint or Smi. | 5 // TODO(srdjan): Make sure the numbers are Bigint and not Mint or Smi. |
6 | 6 |
7 library big_integer_test; | 7 library big_integer_test; |
| 8 import "package:expect/expect.dart"; |
8 | 9 |
9 class BigIntegerTest { | 10 class BigIntegerTest { |
10 | 11 |
11 static foo() { | 12 static foo() { |
12 return 1234567890123456789; | 13 return 1234567890123456789; |
13 } | 14 } |
14 | 15 |
15 static testSmiOverflow() { | 16 static testSmiOverflow() { |
16 var a = 1073741823; | 17 var a = 1073741823; |
17 var b = 1073741822; | 18 var b = 1073741822; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 var a = 10000000000000000000; | 170 var a = 10000000000000000000; |
170 var b = 10000000000000000001; | 171 var b = 10000000000000000001; |
171 Expect.equals(false, a.hashCode == b.hashCode); | 172 Expect.equals(false, a.hashCode == b.hashCode); |
172 Expect.equals(true, a.hashCode == (b - 1).hashCode); | 173 Expect.equals(true, a.hashCode == (b - 1).hashCode); |
173 } | 174 } |
174 } | 175 } |
175 | 176 |
176 main() { | 177 main() { |
177 BigIntegerTest.testMain(); | 178 BigIntegerTest.testMain(); |
178 } | 179 } |
OLD | NEW |