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

Unified Diff: tests/corelib/big_integer_vm_test.dart

Issue 11192074: Fix bigint modulo operation. Fixes bug 6056 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « runtime/vm/bigint_operations.cc ('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_vm_test.dart
===================================================================
--- tests/corelib/big_integer_vm_test.dart (revision 13822)
+++ tests/corelib/big_integer_vm_test.dart (working copy)
@@ -106,7 +106,7 @@
Expect.equals(500000000.0, b / a);
}
- static testBigintRemainder() {
+ static testBigintModulo() {
// Bigint and Smi.
var a = 1000000000005;
var b = 10;
@@ -122,6 +122,15 @@
b = 100000000000;
Expect.equals(1.0, a % b);
Expect.equals(100000000000.0, b % a);
+ // Transitioning from Mint to Bigint.
+ var iStart = 4611686018427387900;
+ var prevX = -23 % iStart;
+ for (int i = iStart + 1; i < iStart + 10; i++) {
+ var x = -23 % i;
+ Expect.equals(1, x - prevX);
+ Expect.isTrue(x > 0);
+ prevX = x;
+ }
}
static testBigintNegate() {
@@ -150,7 +159,7 @@
testBigintAdd();
testBigintSub();
testBigintMul();
- testBigintRemainder();
+ testBigintModulo();
testBigintTruncDiv();
testBigintDiv();
testBigintNegate();
« no previous file with comments | « runtime/vm/bigint_operations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698