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 | 4 |
5 library int64test; | 5 library int64test; |
6 import 'package:fixnum/fixnum.dart'; | 6 import 'package:fixnum/fixnum.dart'; |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 | 8 |
9 void main() { | 9 void main() { |
10 group("arithmetic operators", () { | 10 group("arithmetic operators", () { |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 test("==", () { | 249 test("==", () { |
250 expect(new int64.fromInt(10) == new int64.fromInt(11), false); | 250 expect(new int64.fromInt(10) == new int64.fromInt(11), false); |
251 expect(new int64.fromInt(10) == new int64.fromInt(10), true); | 251 expect(new int64.fromInt(10) == new int64.fromInt(10), true); |
252 expect(new int64.fromInt(12) == new int64.fromInt(11), false); | 252 expect(new int64.fromInt(12) == new int64.fromInt(11), false); |
253 expect(new int64.fromInt(-10) == new int64.fromInt(-10), true); | 253 expect(new int64.fromInt(-10) == new int64.fromInt(-10), true); |
254 expect(new int64.fromInt(-10) != new int64.fromInt(-10), false); | 254 expect(new int64.fromInt(-10) != new int64.fromInt(-10), false); |
255 expect(largePos == largePos, true); | 255 expect(largePos == largePos, true); |
256 expect(largePos == largePosPlusOne, false); | 256 expect(largePos == largePosPlusOne, false); |
257 expect(largePosPlusOne == largePos, false); | 257 expect(largePosPlusOne == largePos, false); |
258 expect(int64.MIN_VALUE == int64.MAX_VALUE, false); | 258 expect(int64.MIN_VALUE == int64.MAX_VALUE, false); |
| 259 expect(new int64.fromInt(17) == new Object(), false); |
259 expect(new int64.fromInt(17) == null, false); | 260 expect(new int64.fromInt(17) == null, false); |
260 }); | 261 }); |
261 | 262 |
262 test(">=", () { | 263 test(">=", () { |
263 expect(new int64.fromInt(10) >= new int64.fromInt(11), false); | 264 expect(new int64.fromInt(10) >= new int64.fromInt(11), false); |
264 expect(new int64.fromInt(10) >= new int64.fromInt(10), true); | 265 expect(new int64.fromInt(10) >= new int64.fromInt(10), true); |
265 expect(new int64.fromInt(12) >= new int64.fromInt(11), true); | 266 expect(new int64.fromInt(12) >= new int64.fromInt(11), true); |
266 expect(new int64.fromInt(-10) >= new int64.fromInt(-11), true); | 267 expect(new int64.fromInt(-10) >= new int64.fromInt(-11), true); |
267 expect(new int64.fromInt(-10) >= new int64.fromInt(-10), true); | 268 expect(new int64.fromInt(-10) >= new int64.fromInt(-10), true); |
268 expect(largePos >= largeNeg, true); | 269 expect(largePos >= largeNeg, true); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 expect(int64.MAX_VALUE.toRadixString(10), "9223372036854775807"); | 575 expect(int64.MAX_VALUE.toRadixString(10), "9223372036854775807"); |
575 expect(int64.MAX_VALUE.toRadixString(11), "1728002635214590697"); | 576 expect(int64.MAX_VALUE.toRadixString(11), "1728002635214590697"); |
576 expect(int64.MAX_VALUE.toRadixString(12), "41A792678515120367"); | 577 expect(int64.MAX_VALUE.toRadixString(12), "41A792678515120367"); |
577 expect(int64.MAX_VALUE.toRadixString(13), "10B269549075433C37"); | 578 expect(int64.MAX_VALUE.toRadixString(13), "10B269549075433C37"); |
578 expect(int64.MAX_VALUE.toRadixString(14), "4340724C6C71DC7A7"); | 579 expect(int64.MAX_VALUE.toRadixString(14), "4340724C6C71DC7A7"); |
579 expect(int64.MAX_VALUE.toRadixString(15), "160E2AD3246366807"); | 580 expect(int64.MAX_VALUE.toRadixString(15), "160E2AD3246366807"); |
580 expect(int64.MAX_VALUE.toRadixString(16), "7FFFFFFFFFFFFFFF"); | 581 expect(int64.MAX_VALUE.toRadixString(16), "7FFFFFFFFFFFFFFF"); |
581 }); | 582 }); |
582 }); | 583 }); |
583 } | 584 } |
OLD | NEW |