Index: tests/compiler/dart2js/forloop_box_test.dart |
diff --git a/tests/compiler/dart2js/forloop_box_test.dart b/tests/compiler/dart2js/forloop_box_test.dart |
index 3d5088258c64c96369a7b187cbd5d585770af676..e44bf61c537ebb6861dc53ea2b9e8aaef2fa59f1 100644 |
--- a/tests/compiler/dart2js/forloop_box_test.dart |
+++ b/tests/compiler/dart2js/forloop_box_test.dart |
@@ -6,7 +6,7 @@ import "package:expect/expect.dart"; |
import "package:async_helper/async_helper.dart"; |
import 'compiler_helper.dart'; |
-String SHOULD_NOT_BE_BOXED_TEST = r''' |
+String TEST = r''' |
main() { |
var a; |
for (var i=0; i<10; i++) { |
@@ -16,7 +16,7 @@ main() { |
} |
'''; |
-String SHOULD_BE_BOXED_TEST = r''' |
+String NEGATIVE_TEST = r''' |
run(f) => f(); |
main() { |
var a; |
@@ -27,31 +27,13 @@ main() { |
} |
'''; |
-String ONLY_UPDATE_LOOP_VAR_TEST = r''' |
-run(f) => f(); |
main() { |
- var a; |
- for (var i=0; i<10; run(() => i++)) { |
- var b = 3; |
- a = () => b = i; |
- } |
- print(a()); |
-} |
-'''; |
- |
-main() { |
- asyncTest(() => compileAll(SHOULD_NOT_BE_BOXED_TEST).then((generated) { |
+ asyncTest(() => compileAll(TEST).then((generated) { |
Expect.isTrue(generated.contains('main_closure(i)'), |
- 'for-loop variable should not have been boxed'); |
- })); |
- asyncTest(() => compileAll(SHOULD_BE_BOXED_TEST).then((generated) { |
- Expect.isFalse(generated.contains('main_closure(i)'), |
- 'for-loop variable should have been boxed'); |
+ 'for-loop variable was boxed'); |
})); |
- asyncTest(() => compileAll(ONLY_UPDATE_LOOP_VAR_TEST).then((generated) { |
+ asyncTest(() => compileAll(NEGATIVE_TEST).then((generated) { |
Expect.isFalse(generated.contains('main_closure(i)'), |
'for-loop variable was not boxed'); |
- Expect.isFalse(generated.contains(', _box_0.b = 3,'), |
- 'non for-loop captured variable should not be updated in loop'); |
})); |
} |