Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2253)

Unified Diff: pkg/fixnum/test/int_64_test.dart

Issue 20803006: Don't throw exception for non-integer args to fixnum int32,int64 op == (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/fixnum/test/int_32_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fixnum/test/int_64_test.dart
diff --git a/pkg/fixnum/test/int_64_test.dart b/pkg/fixnum/test/int_64_test.dart
index fddb409506cdd6b18c8599b8aea68cf2f4a19548..4ff8e1ce1f7953402070951a2e322be100e85792 100644
--- a/pkg/fixnum/test/int_64_test.dart
+++ b/pkg/fixnum/test/int_64_test.dart
@@ -159,7 +159,7 @@ void main() {
expect(int64.MIN_VALUE ~/ new int64.fromInt(1), int64.MIN_VALUE);
expect(int64.MIN_VALUE ~/ new int64.fromInt(-1), int64.MIN_VALUE);
expect(() => new int64.fromInt(17) ~/ int64.ZERO, throws);
- expect(() => new int64.fromInt(17) ~/ null, throws);
+ expect(() => new int64.fromInt(17) ~/ null, throwsArgumentError);
});
test("%", () {
@@ -218,7 +218,10 @@ void main() {
test("<", () {
expect(new int64.fromInt(10) < new int64.fromInt(11), true);
expect(new int64.fromInt(10) < new int64.fromInt(10), false);
- expect(new int64.fromInt(12) < new int64.fromInt(11), false);
+ expect(new int64.fromInt(10) < new int64.fromInt(9), false);
+ expect(new int64.fromInt(10) < new int32.fromInt(11), true);
+ expect(new int64.fromInt(10) < new int32.fromInt(10), false);
+ expect(new int64.fromInt(10) < new int32.fromInt(9), false);
expect(new int64.fromInt(-10) < new int64.fromInt(-11), false);
expect(int64.MIN_VALUE < new int64.fromInt(0), true);
expect(largeNeg < largePos, true);
@@ -233,7 +236,10 @@ void main() {
test("<=", () {
expect(new int64.fromInt(10) <= new int64.fromInt(11), true);
expect(new int64.fromInt(10) <= new int64.fromInt(10), true);
- expect(new int64.fromInt(12) <= new int64.fromInt(11), false);
+ expect(new int64.fromInt(10) <= new int64.fromInt(9), false);
+ expect(new int64.fromInt(10) <= new int32.fromInt(11), true);
+ expect(new int64.fromInt(10) <= new int32.fromInt(10), true);
+ expect(new int64.fromInt(10) <= new int64.fromInt(9), false);
expect(new int64.fromInt(-10) <= new int64.fromInt(-11), false);
expect(new int64.fromInt(-10) <= new int64.fromInt(-10), true);
expect(largeNeg <= largePos, true);
@@ -249,20 +255,27 @@ void main() {
test("==", () {
expect(new int64.fromInt(10) == new int64.fromInt(11), false);
expect(new int64.fromInt(10) == new int64.fromInt(10), true);
- expect(new int64.fromInt(12) == new int64.fromInt(11), false);
+ expect(new int64.fromInt(10) == new int64.fromInt(9), false);
+ expect(new int64.fromInt(10) == new int32.fromInt(11), false);
+ expect(new int64.fromInt(10) == new int32.fromInt(10), true);
+ expect(new int64.fromInt(10) == new int32.fromInt(9), false);
expect(new int64.fromInt(-10) == new int64.fromInt(-10), true);
expect(new int64.fromInt(-10) != new int64.fromInt(-10), false);
expect(largePos == largePos, true);
expect(largePos == largePosPlusOne, false);
expect(largePosPlusOne == largePos, false);
expect(int64.MIN_VALUE == int64.MAX_VALUE, false);
+ expect(new int64.fromInt(17) == new Object(), false);
expect(new int64.fromInt(17) == null, false);
});
test(">=", () {
expect(new int64.fromInt(10) >= new int64.fromInt(11), false);
expect(new int64.fromInt(10) >= new int64.fromInt(10), true);
- expect(new int64.fromInt(12) >= new int64.fromInt(11), true);
+ expect(new int64.fromInt(10) >= new int64.fromInt(9), true);
+ expect(new int64.fromInt(10) >= new int32.fromInt(11), false);
+ expect(new int64.fromInt(10) >= new int32.fromInt(10), true);
+ expect(new int64.fromInt(10) >= new int32.fromInt(9), true);
expect(new int64.fromInt(-10) >= new int64.fromInt(-11), true);
expect(new int64.fromInt(-10) >= new int64.fromInt(-10), true);
expect(largePos >= largeNeg, true);
@@ -278,7 +291,10 @@ void main() {
test(">", () {
expect(new int64.fromInt(10) > new int64.fromInt(11), false);
expect(new int64.fromInt(10) > new int64.fromInt(10), false);
- expect(new int64.fromInt(12) > new int64.fromInt(11), true);
+ expect(new int64.fromInt(10) > new int64.fromInt(9), true);
+ expect(new int64.fromInt(10) > new int32.fromInt(11), false);
+ expect(new int64.fromInt(10) > new int32.fromInt(10), false);
+ expect(new int64.fromInt(10) > new int32.fromInt(9), true);
expect(new int64.fromInt(-10) > new int64.fromInt(-11), true);
expect(new int64.fromInt(10) > new int64.fromInt(-11), true);
expect(new int64.fromInt(-10) > new int64.fromInt(11), false);
@@ -305,21 +321,21 @@ void main() {
expect(n1 & n2, new int64.fromInt(1168));
expect(n3 & n2, new int64.fromInt(8708));
expect(n4 & n5, new int64.fromInt(0x1034) << 32);
- expect(() => n1 & null, throws);
+ expect(() => n1 & null, throwsArgumentError);
});
test("|", () {
expect(n1 | n2, new int64.fromInt(9942));
expect(n3 | n2, new int64.fromInt(-66));
expect(n4 | n5, new int64.fromInt(0x9a76) << 32);
- expect(() => n1 | null, throws);
+ expect(() => n1 | null, throwsArgumentError);
});
test("^", () {
expect(n1 ^ n2, new int64.fromInt(8774));
expect(n3 ^ n2, new int64.fromInt(-8774));
expect(n4 ^ n5, new int64.fromInt(0x8a42) << 32);
- expect(() => n1 ^ null, throws);
+ expect(() => n1 ^ null, throwsArgumentError);
});
test("~", () {
« no previous file with comments | « pkg/fixnum/test/int_32_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698