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:expect/expect.dart"; |
6 import 'package:fixnum/fixnum.dart'; | 7 import 'package:fixnum/fixnum.dart'; |
7 | 8 |
8 void main() { | 9 void main() { |
9 Expect.equals("0", new int32.fromInt(0).toString()); | 10 Expect.equals("0", new int32.fromInt(0).toString()); |
10 Expect.equals("1", new int32.fromInt(1).toString()); | 11 Expect.equals("1", new int32.fromInt(1).toString()); |
11 Expect.equals("-1", new int32.fromInt(-1).toString()); | 12 Expect.equals("-1", new int32.fromInt(-1).toString()); |
12 Expect.equals("1000", new int32.fromInt(1000).toString()); | 13 Expect.equals("1000", new int32.fromInt(1000).toString()); |
13 Expect.equals("-1000", new int32.fromInt(-1000).toString()); | 14 Expect.equals("-1000", new int32.fromInt(-1000).toString()); |
14 Expect.equals("2147483647", new int32.fromInt(2147483647).toString()); | 15 Expect.equals("2147483647", new int32.fromInt(2147483647).toString()); |
15 Expect.equals("-2147483648", new int32.fromInt(2147483648).toString()); | 16 Expect.equals("-2147483648", new int32.fromInt(2147483648).toString()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 150 } |
150 | 151 |
151 try { | 152 try { |
152 new int32.fromInt(17) < null; | 153 new int32.fromInt(17) < null; |
153 Expect.fail("x >= null should throw ArgumentError"); | 154 Expect.fail("x >= null should throw ArgumentError"); |
154 } on ArgumentError catch (e) { | 155 } on ArgumentError catch (e) { |
155 } | 156 } |
156 | 157 |
157 Expect.isFalse(new int32.fromInt(17) == null); | 158 Expect.isFalse(new int32.fromInt(17) == null); |
158 } | 159 } |
OLD | NEW |