Chromium Code Reviews| 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,10 @@ |
| Expect.equals(2.0, 10 / 5); |
| Expect.equals(2, a % b); |
| Expect.equals(2, a.remainder(b)); |
| + a = -(1 << 30); |
| + b = -1; |
| + // Smi corner cases. |
| + Expect.equals(1 << 30, a ~/ b); |
|
regis
2011/12/14 00:58:03
You could already add a test for 62-bit Smi.
sra1
2011/12/14 01:05:25
I would loop, 30 and 62 are not the only choices.
srdjan
2011/12/14 01:14:30
Looping 1..80
|
| a = 22; |
| b = 4.0; |
| // Smi & double. |
| @@ -388,6 +392,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() { |