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

Unified Diff: language/src/ArithmeticTest.dart

Issue 8935015: Expand ArithmeticTest to include truncate divide corner case and to trigger optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/tests/
Patch Set: '' Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: language/src/ArithmeticTest.dart
===================================================================
--- language/src/ArithmeticTest.dart (revision 2396)
+++ language/src/ArithmeticTest.dart (working copy)
@@ -34,7 +34,7 @@
}
}
- static testMain() {
+ static runOne() {
var a = 22;
var b = 4;
// Smi & smi.
@@ -46,6 +46,12 @@
Expect.equals(2.0, 10 / 5);
Expect.equals(2, a % b);
Expect.equals(2, a.remainder(b));
+ // Smi corner cases.
+ for (int i = 0; i < 80; i++) {
+ a = -(1 << i);
+ b = -1;
+ Expect.equals(1 << i, a ~/ b);
+ }
a = 22;
b = 4.0;
// Smi & double.
@@ -388,6 +394,12 @@
Expect.equals(false, (3).hashCode() == (1).hashCode());
Expect.equals(true, (10).hashCode() == (10).hashCode());
}
+
+ static testMain() {
+ for (int i = 0; i < 1500; i++) {
+ runOne();
+ }
+ }
}
main() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698