| 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("is-tests", () { | 10 group("is-tests", () { |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 checkInt(12345678); | 651 checkInt(12345678); |
| 652 checkInt(-12345678); | 652 checkInt(-12345678); |
| 653 checkInt(2147483647); | 653 checkInt(2147483647); |
| 654 checkInt(2147483648); | 654 checkInt(2147483648); |
| 655 checkInt(-2147483647); | 655 checkInt(-2147483647); |
| 656 checkInt(-2147483648); | 656 checkInt(-2147483648); |
| 657 checkInt(4294967295); | 657 checkInt(4294967295); |
| 658 checkInt(4294967296); | 658 checkInt(4294967296); |
| 659 checkInt(-4294967295); | 659 checkInt(-4294967295); |
| 660 checkInt(-4294967296); | 660 checkInt(-4294967296); |
| 661 expect(() => Int64.parseRadix('xyzzy', -1), throwsArgumentError); |
| 662 expect(() => Int64.parseRadix('plugh', 10), |
| 663 throwsA(new isInstanceOf<FormatException>())); |
| 661 }); | 664 }); |
| 662 | 665 |
| 663 test("parseRadix", () { | 666 test("parseRadix", () { |
| 664 check(String s, int r, String x) { | 667 check(String s, int r, String x) { |
| 665 expect(Int64.parseRadix(s, r).toString(), x); | 668 expect(Int64.parseRadix(s, r).toString(), x); |
| 666 } | 669 } |
| 667 check('ghoul', 36, '27699213'); | 670 check('ghoul', 36, '27699213'); |
| 668 check('ghoul', 35, '24769346'); | 671 check('ghoul', 35, '24769346'); |
| 669 // Min and max value. | 672 // Min and max value. |
| 670 check("-9223372036854775808", 10, "-9223372036854775808"); | 673 check("-9223372036854775808", 10, "-9223372036854775808"); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 expect(Int64.MAX_VALUE.toRadixString(10), "9223372036854775807"); | 745 expect(Int64.MAX_VALUE.toRadixString(10), "9223372036854775807"); |
| 743 expect(Int64.MAX_VALUE.toRadixString(11), "1728002635214590697"); | 746 expect(Int64.MAX_VALUE.toRadixString(11), "1728002635214590697"); |
| 744 expect(Int64.MAX_VALUE.toRadixString(12), "41a792678515120367"); | 747 expect(Int64.MAX_VALUE.toRadixString(12), "41a792678515120367"); |
| 745 expect(Int64.MAX_VALUE.toRadixString(13), "10b269549075433c37"); | 748 expect(Int64.MAX_VALUE.toRadixString(13), "10b269549075433c37"); |
| 746 expect(Int64.MAX_VALUE.toRadixString(14), "4340724c6c71dc7a7"); | 749 expect(Int64.MAX_VALUE.toRadixString(14), "4340724c6c71dc7a7"); |
| 747 expect(Int64.MAX_VALUE.toRadixString(15), "160e2ad3246366807"); | 750 expect(Int64.MAX_VALUE.toRadixString(15), "160e2ad3246366807"); |
| 748 expect(Int64.MAX_VALUE.toRadixString(16), "7fffffffffffffff"); | 751 expect(Int64.MAX_VALUE.toRadixString(16), "7fffffffffffffff"); |
| 749 }); | 752 }); |
| 750 }); | 753 }); |
| 751 } | 754 } |
| OLD | NEW |