Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: tests/language/rewrite_while_test.dart

Issue 312793002: dart2dart: Preserve variable names throughout the IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SVN rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/rewrite_variable_initializer_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/rewrite_while_test.dart
diff --git a/tests/language/rewrite_while_test.dart b/tests/language/rewrite_while_test.dart
index 18c6539318561e2600d5def9fcbef69d3f03802d..e7375ef927a165711fadff26574d24c72df1156c 100644
--- a/tests/language/rewrite_while_test.dart
+++ b/tests/language/rewrite_while_test.dart
@@ -38,6 +38,18 @@ loop3(x) {
return n;
}
+loop4(x) {
+ var n = 0;
+ if (x < 100) {
+ while (n < x) {
+ baz();
+ n = n + 1;
+ }
+ }
+ baz();
+ return n;
+}
+
f1(b) {
while (b)
return 1;
@@ -64,6 +76,10 @@ main() {
Expect.equals(10, loop3(10));
Expect.equals(0, loop3(200));
+ Expect.equals(0, loop4(-10));
+ Expect.equals(10, loop4(10));
+ Expect.equals(0, loop4(200));
+
Expect.equals(1, f1(true));
Expect.equals(2, f1(false));
Expect.equals(1, f2(true));
« no previous file with comments | « tests/language/rewrite_variable_initializer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698