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

Unified Diff: tests/corelib/big_integer_arith_vm_test.dart

Issue 1209523002: Make modInv throw Exception on incompatible operands. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Merge to head, make tests run. Created 5 years, 6 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
« sdk/lib/_internal/js_runtime/lib/js_number.dart ('K') | « sdk/lib/core/int.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/big_integer_arith_vm_test.dart
diff --git a/tests/corelib/big_integer_arith_vm_test.dart b/tests/corelib/big_integer_arith_vm_test.dart
index 8b76ba0410d1a7bcb39e75f6a3ecfaeac193e13c..03246ba34325ca9b3eff900a3ad774158a4381a7 100644
--- a/tests/corelib/big_integer_arith_vm_test.dart
+++ b/tests/corelib/big_integer_arith_vm_test.dart
@@ -231,7 +231,7 @@ testBigintModInverse() {
Expect.equals(0, x.modInverse(m));
x = 0;
m = 1000000001;
- Expect.throws(() => x.modInverse(m), (e) => e is RangeError); // Not coprime.
+ Expect.throws(() => x.modInverse(m), (e) => e is Exception); // Not coprime.
x = 1234567890;
m = 19;
Expect.equals(11, x.modInverse(m));
@@ -240,7 +240,7 @@ testBigintModInverse() {
Expect.equals(189108911, x.modInverse(m));
x = 19;
m = 1000000001;
- Expect.throws(() => x.modInverse(m), (e) => e is RangeError); // Not coprime.
+ Expect.throws(() => x.modInverse(m), (e) => e is Exception); // Not coprime.
x = 19;
m = 1234567890;
Expect.equals(519818059, x.modInverse(m));
@@ -249,7 +249,7 @@ testBigintModInverse() {
Expect.equals(1001100101, x.modInverse(m));
x = 1000000001;
m = 19;
- Expect.throws(() => x.modInverse(m), (e) => e is RangeError); // Not coprime.
+ Expect.throws(() => x.modInverse(m), (e) => e is Exception); // Not coprime.
x = 12345678901234567890;
m = 19;
Expect.equals(3, x.modInverse(m));
@@ -276,7 +276,7 @@ testBigintModInverse() {
Expect.equals(3, x.modInverse(m));
x = 123456789012345678901234567890;
m = 123456789012345678901234567899;
- Expect.throws(() => x.modInverse(m), (e) => e is RangeError); // Not coprime.
+ Expect.throws(() => x.modInverse(m), (e) => e is Exception); // Not coprime.
x = 123456789012345678901234567890;
m = 123456789012345678901234567891;
Expect.equals(123456789012345678901234567890, x.modInverse(m));
@@ -285,7 +285,7 @@ testBigintModInverse() {
Expect.equals(77160493132716049313271604932, x.modInverse(m));
x = 123456789012345678901234567899;
m = 123456789012345678901234567890;
- Expect.throws(() => x.modInverse(m), (e) => e is RangeError); // Not coprime.
+ Expect.throws(() => x.modInverse(m), (e) => e is Exception); // Not coprime.
x = 123456789012345678901234567891;
m = 123456789012345678901234567890;
Expect.equals(1, x.modInverse(m));
@@ -310,10 +310,10 @@ testBigintGcd() {
Expect.equals(21 <<40, x.gcd(m));
x = 0;
m = 1000000001;
- Expect.throws(() => x.gcd(m), (e) => e is RangeError);
+ Expect.throws(() => x.gcd(m), (e) => e is ArgumentError);
x = 1000000001;
m = 0;
- Expect.throws(() => x.gcd(m), (e) => e is RangeError);
+ Expect.throws(() => x.gcd(m), (e) => e is ArgumentError);
x = 1234567890;
m = 19;
Expect.equals(1, x.gcd(m));
« sdk/lib/_internal/js_runtime/lib/js_number.dart ('K') | « sdk/lib/core/int.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698