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

Unified Diff: tests/language/rewrite_while_test.dart

Issue 288343014: dart2dart: Test cases for better code coverage in dart_tree rewritings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SVN rebase Created 6 years, 7 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_nested_if3_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 5bb110562ccdd0bb34d47f9e3aa45fadb2b7580e..44e72eda8d93139a0035599eadf82ef2fa2b0791 100644
--- a/tests/language/rewrite_while_test.dart
+++ b/tests/language/rewrite_while_test.dart
@@ -4,6 +4,7 @@
import "package:expect/expect.dart";
+
baz() {}
loop1(x) {
@@ -25,8 +26,30 @@ loop2(x) {
return n;
}
+f1(b) {
+ while (b)
+ return 1;
+
+ return 2;
+}
+
+f2(b) {
+ while (b) {
+ return 1;
+ }
+ return 2;
+}
+
main() {
+ Expect.equals(0, loop1(-10));
Expect.equals(10, loop1(10));
+
+ Expect.equals(0, loop2(-10));
Expect.equals(10, loop2(10));
- Expect.equals(0, loop2(200));
+ Expect.equals(0, loop2(200));
+
+ Expect.equals(1, f1(true));
+ Expect.equals(2, f1(false));
+ Expect.equals(1, f2(true));
+ Expect.equals(2, f2(false));
}
« no previous file with comments | « tests/language/rewrite_nested_if3_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698