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

Unified Diff: tests/language/rewrite_assign_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: 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
Index: tests/language/rewrite_assign_test.dart
diff --git a/tests/compiler/dart2js_extra/16407_test.dart b/tests/language/rewrite_assign_test.dart
similarity index 54%
copy from tests/compiler/dart2js_extra/16407_test.dart
copy to tests/language/rewrite_assign_test.dart
index aff1ba337ddab1eb5d219ac635653b48d4f8d1bc..5379a6ca35bf171a8d2f276529597b1355e26a57 100644
--- a/tests/compiler/dart2js_extra/16407_test.dart
+++ b/tests/language/rewrite_assign_test.dart
@@ -4,13 +4,23 @@
import "package:expect/expect.dart";
asgerf 2014/05/22 13:49:35 This file (rewrite_assign_test.dart) did not exist
sigurdm 2014/05/27 12:05:34 It tries to find a similar file. git cl upload tak
-// Regression test for Issue 16407.
+bar(x,y) {}
-void main() {
- foo(null, true);
- foo('x', false);
+foo(b) {
+ var x, y;
+ if (b) {
+ x = 1;
+ y = 2;
+ } else {
+ x = 2;
+ y = 1;
+ }
+ bar(x,y);
+ bar(x,y);
+ return x;
}
-var foo = (x, result) {
- Expect.equals(result, x is Null, '$x is Null');
-};
+main() {
+ Expect.equals(1, foo(true));
+ Expect.equals(2, foo(false));
+}

Powered by Google App Engine
This is Rietveld 408576698