Index: pkg/analyzer2dart/test/end2end_data.dart |
diff --git a/pkg/analyzer2dart/test/end2end_data.dart b/pkg/analyzer2dart/test/end2end_data.dart |
index 572f294276fe27e0b952d23ac8ffb557050042ab..99fb7fff4f069f73d83bda08a6f2e45f2aeaf6b7 100644 |
--- a/pkg/analyzer2dart/test/end2end_data.dart |
+++ b/pkg/analyzer2dart/test/end2end_data.dart |
@@ -645,4 +645,59 @@ main() { |
} |
}'''), |
]), |
+ |
+ const Group('For in loop', const <TestSpec>[ |
+// TODO(johnniwinther): Add tests for `i` as top-level, static and instance |
+// fields. |
+ const TestSpec(''' |
+main(a) { |
+ for (var i in a) { |
+ print(i); |
+ } |
+} |
+''', ''' |
+main(a) { |
+ var v0 = a.iterator; |
+ while (v0.moveNext()) { |
+ print(v0.current); |
+ } |
+}'''), |
+ |
+ const TestSpec(''' |
+main(a) { |
+ for (var i in a) { |
+ print(i); |
+ i = 0; |
+ print(i); |
+ } |
+} |
+''', ''' |
+main(a) { |
+ var v0 = a.iterator, i; |
+ while (v0.moveNext()) { |
+ i = v0.current; |
+ print(i); |
+ i = 0; |
+ print(i); |
+ } |
+} |
+'''), |
+ |
+ const TestSpec(''' |
+main(a) { |
+ var i; |
+ for (i in a) { |
+ print(i); |
+ } |
+} |
+''', ''' |
+main(a) { |
+ var i, v0 = a.iterator; |
+ while (v0.moveNext()) { |
+ i = v0.current; |
+ print(i); |
+ } |
+} |
+'''), |
+ ]), |
]; |