Index: tests/kernel/unsorted/for_in_loop_test.dart |
diff --git a/tests/kernel/unsorted/for_in_loop_test.dart b/tests/kernel/unsorted/for_in_loop_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..223325f1d02d75bd52d94f34e1a6f00ce9dd1549 |
--- /dev/null |
+++ b/tests/kernel/unsorted/for_in_loop_test.dart |
@@ -0,0 +1,38 @@ |
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+// Tests of for-in loops and list literals. |
+ |
+import 'expect.dart'; |
+ |
+fact4() { |
+ var f = 1; |
+ for (var n in [1, 2, 3, 4]) { |
+ f *= n; |
+ } |
+ return f; |
+} |
+ |
+fact5() { |
+ var f = 1, n; |
+ for (n in [1, 2, 3, 4, 5]) { |
+ f *= n; |
+ } |
+ return f; |
+} |
+ |
+var global; |
+fact6() { |
+ var f = 1; |
+ for (global in [1, 2, 3, 4, 5, 6]) { |
+ f *= global; |
+ } |
+ return f; |
+} |
+ |
+main() { |
+ Expect.isTrue(fact4() == 24); |
+ Expect.isTrue(fact5() == 120); |
+ Expect.isTrue(fact6() == 720); |
+} |