Index: tests/language/compound_assignment_operator_test.dart |
diff --git a/tests/language/compound_assignment_operator_test.dart b/tests/language/compound_assignment_operator_test.dart |
index 65bf4c391131deda8ec5cb22073ec9b8c2fff3e6..70a070081b3634eaace9792692dd8780604cf138 100644 |
--- a/tests/language/compound_assignment_operator_test.dart |
+++ b/tests/language/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); |