Index: tests/language_strong/div_with_power_of_two2_test.dart |
diff --git a/tests/language_strong/div_with_power_of_two2_test.dart b/tests/language_strong/div_with_power_of_two2_test.dart |
index 03a83cab7a0211a027b8536c8d6829bf017e5011..c8e3bdbfb5188c7644589b06404a1c22581a3e51 100644 |
--- a/tests/language_strong/div_with_power_of_two2_test.dart |
+++ b/tests/language_strong/div_with_power_of_two2_test.dart |
@@ -8,69 +8,117 @@ |
import "package:expect/expect.dart"; |
// [function, [list of tuples argument/result]]. |
-var expectedResults = |
- [ [divBy1, |
- [[134217730, 134217730], |
- [-134217730, -134217730], |
- [10, 10], |
- [-10, -10]]], |
- [divByNeg1, |
- [[134217730, -134217730], |
- [-134217730, 134217730], |
- [10, -10], |
- [-10, 10]]], |
- [divBy2, |
- [[134217730, 67108865], |
- [-134217730, -67108865], |
- [10, 5], |
- [-10, -5]]], |
- [divByNeg2, |
- [[134217730, -67108865], |
- [-134217730, 67108865], |
- [10, -5], |
- [-10, 5]]], |
- [divBy4, |
- [[134217730, 33554432], |
- [-134217730, -33554432], |
- [10, 2], |
- [-10, -2]]], |
- [divByNeg4, |
- [[134217730, -33554432], |
- [-134217730, 33554432], |
- [10, -2], |
- [-10, 2]]], |
- [divBy134217728, |
- [[134217730, 1], |
- [-134217730, -1], |
- [10, 0], |
- [-10, 0]]], |
- [divByNeg134217728, |
- [[134217730, -1], |
- [-134217730, 1], |
- [10, 0], |
- [-10, 0]]], |
- // Use different functions for 64 bit arguments. |
- [divBy4_, |
- [[549755813990, 137438953497], |
- [-549755813990, -137438953497], |
- [288230925907525632, 72057731476881408], |
- [-288230925907525632, -72057731476881408]]], |
- [divByNeg4_, |
- [[549755813990, -137438953497], |
- [-549755813990, 137438953497], |
- [288230925907525632, -72057731476881408], |
- [-288230925907525632, 72057731476881408]]], |
- [divBy549755813888, |
- [[549755813990, 1], |
- [-549755813990, -1], |
- [288230925907525632, 524289], |
- [-288230925907525632, -524289]]], |
- [divByNeg549755813888, |
- [[549755813990, -1], |
- [-549755813990, 1], |
- [288230925907525632, -524289], |
- [-288230925907525632, 524289]]], |
- ]; |
+var expectedResults = [ |
+ [ |
+ divBy1, |
+ [ |
+ [134217730, 134217730], |
+ [-134217730, -134217730], |
+ [10, 10], |
+ [-10, -10] |
+ ] |
+ ], |
+ [ |
+ divByNeg1, |
+ [ |
+ [134217730, -134217730], |
+ [-134217730, 134217730], |
+ [10, -10], |
+ [-10, 10] |
+ ] |
+ ], |
+ [ |
+ divBy2, |
+ [ |
+ [134217730, 67108865], |
+ [-134217730, -67108865], |
+ [10, 5], |
+ [-10, -5] |
+ ] |
+ ], |
+ [ |
+ divByNeg2, |
+ [ |
+ [134217730, -67108865], |
+ [-134217730, 67108865], |
+ [10, -5], |
+ [-10, 5] |
+ ] |
+ ], |
+ [ |
+ divBy4, |
+ [ |
+ [134217730, 33554432], |
+ [-134217730, -33554432], |
+ [10, 2], |
+ [-10, -2] |
+ ] |
+ ], |
+ [ |
+ divByNeg4, |
+ [ |
+ [134217730, -33554432], |
+ [-134217730, 33554432], |
+ [10, -2], |
+ [-10, 2] |
+ ] |
+ ], |
+ [ |
+ divBy134217728, |
+ [ |
+ [134217730, 1], |
+ [-134217730, -1], |
+ [10, 0], |
+ [-10, 0] |
+ ] |
+ ], |
+ [ |
+ divByNeg134217728, |
+ [ |
+ [134217730, -1], |
+ [-134217730, 1], |
+ [10, 0], |
+ [-10, 0] |
+ ] |
+ ], |
+ // Use different functions for 64 bit arguments. |
+ [ |
+ divBy4_, |
+ [ |
+ [549755813990, 137438953497], |
+ [-549755813990, -137438953497], |
+ [288230925907525632, 72057731476881408], |
+ [-288230925907525632, -72057731476881408] |
+ ] |
+ ], |
+ [ |
+ divByNeg4_, |
+ [ |
+ [549755813990, -137438953497], |
+ [-549755813990, 137438953497], |
+ [288230925907525632, -72057731476881408], |
+ [-288230925907525632, 72057731476881408] |
+ ] |
+ ], |
+ [ |
+ divBy549755813888, |
+ [ |
+ [549755813990, 1], |
+ [-549755813990, -1], |
+ [288230925907525632, 524289], |
+ [-288230925907525632, -524289] |
+ ] |
+ ], |
+ [ |
+ divByNeg549755813888, |
+ [ |
+ [549755813990, -1], |
+ [-549755813990, 1], |
+ [288230925907525632, -524289], |
+ [-288230925907525632, 524289] |
+ ] |
+ ], |
+]; |
divBy0(a) => a ~/ 0; |
divBy1(a) => a ~/ 1; |
@@ -98,8 +146,7 @@ main() { |
Expect.equals(res, f(arg)); |
} |
} |
- Expect.throws(() => divBy0(4), |
- (e) => e is IntegerDivisionByZeroException |
- || e is UnsupportedError); |
+ Expect.throws(() => divBy0(4), |
+ (e) => e is IntegerDivisionByZeroException || e is UnsupportedError); |
} |
} |