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

Unified Diff: tests/language/div_with_power_of_two2_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
Index: tests/language/div_with_power_of_two2_test.dart
diff --git a/tests/language/div_with_power_of_two2_test.dart b/tests/language/div_with_power_of_two2_test.dart
index f242fedc56a2d0e0dc254d6bbd66474ab12c845a..05e8580d97f506806f1cf8c2f3d2133cf197e9fb 100644
--- a/tests/language/div_with_power_of_two2_test.dart
+++ b/tests/language/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);
}
}

Powered by Google App Engine
This is Rietveld 408576698