| Index: tests/language/rewrite_for_update_order.dart
|
| diff --git a/tests/language/rewrite_if_swap_test.dart b/tests/language/rewrite_for_update_order.dart
|
| similarity index 50%
|
| copy from tests/language/rewrite_if_swap_test.dart
|
| copy to tests/language/rewrite_for_update_order.dart
|
| index 0b515bf952e34a479a3a38611c2d93037ff6df2f..80ed9de9182175758cbd840b28fa025326b9876b 100644
|
| --- a/tests/language/rewrite_if_swap_test.dart
|
| +++ b/tests/language/rewrite_for_update_order.dart
|
| @@ -4,30 +4,29 @@
|
|
|
| import "package:expect/expect.dart";
|
|
|
| +var counter = 0;
|
| var global = 0;
|
|
|
| -bar() {
|
| - global += 1;
|
| +test() {
|
| + ++counter;
|
| + return counter <= 2;
|
| }
|
| -baz() {
|
| - global += 100;
|
| +
|
| +first() {
|
| + global = global + 1;
|
| +}
|
| +second() {
|
| + global = global * 2;
|
| }
|
|
|
| -foo(b) {
|
| - var old_backend_was_used;
|
| - if (b ? false : true) {
|
| - bar();
|
| - bar();
|
| - } else {
|
| - baz();
|
| - baz();
|
| +foo() {
|
| + while (test()) {
|
| + first();
|
| + second();
|
| }
|
| }
|
|
|
| main() {
|
| - foo(true);
|
| - Expect.equals(200, global);
|
| -
|
| - foo(false);
|
| - Expect.equals(202, global);
|
| + foo();
|
| + Expect.equals(6, global);
|
| }
|
|
|