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 int32test; | 5 library int32test; |
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 expect(int32.MIN_VALUE <= int32.MAX_VALUE, true); | 106 expect(int32.MIN_VALUE <= int32.MAX_VALUE, true); |
107 expect(int32.MAX_VALUE <= int32.MIN_VALUE, false); | 107 expect(int32.MAX_VALUE <= int32.MIN_VALUE, false); |
108 expect(() => new int32.fromInt(17) <= null, throws); | 108 expect(() => new int32.fromInt(17) <= null, throws); |
109 }); | 109 }); |
110 | 110 |
111 test("==", () { | 111 test("==", () { |
112 expect(new int32.fromInt(17) == new int32.fromInt(18), false); | 112 expect(new int32.fromInt(17) == new int32.fromInt(18), false); |
113 expect(new int32.fromInt(17) == new int32.fromInt(17), true); | 113 expect(new int32.fromInt(17) == new int32.fromInt(17), true); |
114 expect(new int32.fromInt(17) == new int32.fromInt(16), false); | 114 expect(new int32.fromInt(17) == new int32.fromInt(16), false); |
115 expect(int32.MIN_VALUE == int32.MAX_VALUE, false); | 115 expect(int32.MIN_VALUE == int32.MAX_VALUE, false); |
| 116 expect(new int32.fromInt(17) == new Object(), false); |
116 expect(new int32.fromInt(17) == null, false); | 117 expect(new int32.fromInt(17) == null, false); |
117 }); | 118 }); |
118 | 119 |
119 test(">=", () { | 120 test(">=", () { |
120 expect(new int32.fromInt(17) >= new int32.fromInt(18), false); | 121 expect(new int32.fromInt(17) >= new int32.fromInt(18), false); |
121 expect(new int32.fromInt(17) >= new int32.fromInt(17), true); | 122 expect(new int32.fromInt(17) >= new int32.fromInt(17), true); |
122 expect(new int32.fromInt(17) >= new int32.fromInt(16), true); | 123 expect(new int32.fromInt(17) >= new int32.fromInt(16), true); |
123 expect(int32.MIN_VALUE >= int32.MAX_VALUE, false); | 124 expect(int32.MIN_VALUE >= int32.MAX_VALUE, false); |
124 expect(int32.MAX_VALUE >= int32.MIN_VALUE, true); | 125 expect(int32.MAX_VALUE >= int32.MIN_VALUE, true); |
125 expect(() => new int32.fromInt(17) >= null, throws); | 126 expect(() => new int32.fromInt(17) >= null, throws); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 "ffffff"); | 228 "ffffff"); |
228 }); | 229 }); |
229 }); | 230 }); |
230 | 231 |
231 group("toRadixString", () { | 232 group("toRadixString", () { |
232 test("returns base n string representation", () { | 233 test("returns base n string representation", () { |
233 expect(new int32.fromInt(123456789).toRadixString(5), "223101104124"); | 234 expect(new int32.fromInt(123456789).toRadixString(5), "223101104124"); |
234 }); | 235 }); |
235 }); | 236 }); |
236 } | 237 } |
OLD | NEW |