Chromium Code Reviews| Index: tests/language/arithmetic_test.dart |
| =================================================================== |
| --- tests/language/arithmetic_test.dart (revision 16928) |
| +++ tests/language/arithmetic_test.dart (working copy) |
| @@ -282,17 +282,14 @@ |
| Expect.equals(2.0, (2.1).round()); |
| Expect.equals(-2.0, (-2.1).round()); |
| Expect.equals(1.0, (0.5).round()); |
| - // TODO(floitsch): enable or adapt test, once we reached conclusion on |
| - // b/4539188. |
| - // Expect.equals(-0.0, (-0.5).round()); |
| - // TODO(srdjan): enable the following tests once isNegative works. |
| - // Expect.equals(true, (-0.0).round().isNegative); |
| - // Expect.equals(true, (-0.3).round().isNegative); |
| - // Expect.equals(true, (-0.5).round().isNegative); |
| + Expect.equals(0.0, (0.49999999999999994).round()); |
| + Expect.equals(-0.0, (-0.49999999999999994).round()); |
| + Expect.equals(-1.0, (-0.5).round()); |
| + Expect.equals(true, (-0.0).round().isNegative); |
| + Expect.equals(true, (-0.3).round().isNegative); |
| + Expect.equals(true, (-0.5).round().isNegative); |
| Expect.equals(2.0, (1.5).round()); |
| - // TODO(floitsch): enable or adapt test, once we reached conclusion on |
| - // b/4539188. |
| - // Expect.equals(-1.0, (-1.5).round()); |
| + Expect.equals(-2.0, (-1.5).round()); |
|
Florian Schneider
2013/01/11 09:49:30
Please also add another corner case (2^53-1) and -
srdjan
2013/01/11 19:41:08
Thanks, using 9007199254740991.0.
|
| Expect.equals(1.0, (0.99).round()); |
| // -- toInt --. |