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

Unified Diff: pkg/analyzer2dart/test/end2end_test.dart

Issue 661593004: Support local variables in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove blank lines. Created 6 years, 2 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: pkg/analyzer2dart/test/end2end_test.dart
diff --git a/pkg/analyzer2dart/test/end2end_test.dart b/pkg/analyzer2dart/test/end2end_test.dart
index 52055e4a4cbdd68dcf0721758db0175e922d7b31..11e9691d25bd3d99ed7addc1ddca3dd20a9b5fce 100644
--- a/pkg/analyzer2dart/test/end2end_test.dart
+++ b/pkg/analyzer2dart/test/end2end_test.dart
@@ -176,6 +176,28 @@ main(args) {
}
''');
});
+
+ test('Local variables', () {
+ checkResult('''
+main() {
+ var a;
+ return a;
+}
+''', '''
+main() {}
+''');
+
+ checkResult('''
+main() {
+ var a = 0;
+ return a;
+}
+''', '''
+main() {
+ return 0;
+}
+''');
+ });
}
checkResult(String input, [String expectedOutput]) {

Powered by Google App Engine
This is Rietveld 408576698