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

Unified Diff: tests/language_strong/compound_assignment_operator_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_strong/compound_assignment_operator_test.dart
diff --git a/tests/language_strong/compound_assignment_operator_test.dart b/tests/language_strong/compound_assignment_operator_test.dart
index e04da408babc9e3c028dea5f3e9f7358b10e6827..40f9d10770f4cf82b15b56b44efd32bfa04ee4d4 100644
--- a/tests/language_strong/compound_assignment_operator_test.dart
+++ b/tests/language_strong/compound_assignment_operator_test.dart
@@ -7,7 +7,9 @@
import "package:expect/expect.dart";
class Indexed {
- Indexed() : _f = new List(10), count = 0 {
+ Indexed()
+ : _f = new List(10),
+ count = 0 {
_f[0] = 100;
_f[1] = 200;
}
@@ -15,6 +17,7 @@ class Indexed {
count++;
return _f;
}
+
var count;
var _f;
}
@@ -22,16 +25,24 @@ class Indexed {
var result;
class A {
- get field { result.add(1); return 1; }
+ get field {
+ result.add(1);
+ return 1;
+ }
+
set field(value) {}
- static get static_field { result.add(0); return 1; }
- static set static_field(value) { result.add(1); }
-}
+ static get static_field {
+ result.add(0);
+ return 1;
+ }
+ static set static_field(value) {
+ result.add(1);
+ }
+}
class CompoundAssignmentOperatorTest {
-
static void testIndexed() {
Indexed indexed = new Indexed();
Expect.equals(0, indexed.count);
@@ -52,21 +63,43 @@ class CompoundAssignmentOperatorTest {
}
static testIndexedMore() {
- result = [];
- array() { result.add(0); return [0]; }
- index() { result.add(1); return 0; }
- middle() { result.add(2); }
- sequence(a, b, c) { result.add(3); }
-
- sequence(array()[index()] += 1, middle(), array()[index()] += 1);
- Expect.listEquals([0, 1, 2, 0, 1, 3], result);
+ result = [];
+ array() {
+ result.add(0);
+ return [0];
+ }
+
+ index() {
+ result.add(1);
+ return 0;
+ }
+
+ middle() {
+ result.add(2);
+ }
+
+ sequence(a, b, c) {
+ result.add(3);
+ }
+
+ sequence(array()[index()] += 1, middle(), array()[index()] += 1);
+ Expect.listEquals([0, 1, 2, 0, 1, 3], result);
}
static testIndexedMoreMore() {
result = [];
- middle() { result.add(2); }
- obj() { result.add(0); return new A(); }
- sequence(a, b, c) { result.add(3); }
+ middle() {
+ result.add(2);
+ }
+
+ obj() {
+ result.add(0);
+ return new A();
+ }
+
+ sequence(a, b, c) {
+ result.add(3);
+ }
sequence(obj().field += 1, middle(), obj().field += 1);
Expect.listEquals([0, 1, 2, 0, 1, 3], result);

Powered by Google App Engine
This is Rietveld 408576698