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

Unified Diff: tests/compiler/dart2js/unparser_test.dart

Issue 10735030: dart2dart fix synthesized constructor appearing in unparser. Don't output it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « lib/compiler/implementation/dart_backend/backend.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/unparser_test.dart
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index 184b4d448484f31fbd50de93a0ce5dac1c5a71e7..81afebae6902a4dfe21b653241592ff293dd1073 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -32,7 +32,7 @@ interface Dynamic {}
interface Null {}
''';
-testDart2Dart(String src, void continuation(String s)) {
+testDart2Dart(String src, [void continuation(String s)]) {
fileUri(path) => new Uri(scheme: 'file', path: path);
final scriptUri = fileUri('script.dart');
@@ -49,6 +49,10 @@ testDart2Dart(String src, void continuation(String s)) {
}
}
+ // If continuation is not provided, check that source string remains the same.
+ if (continuation == null) {
+ continuation = (s) => Expect.equals(src, s);
+ }
compile(
scriptUri,
fileUri('libraryRoot'),
@@ -119,8 +123,7 @@ main() {
}
testTopLevelField() {
- final src = 'final String x="asd";main(){x;}';
- testDart2Dart(src, (String s) => Expect.equals(src, s));
+ testDart2Dart('final String x="asd";main(){x;}');
}
testSimpleObjectInstantiation() {
@@ -128,8 +131,15 @@ testSimpleObjectInstantiation() {
}
testSimpleTopLevelClass() {
- final src = 'main(){new A();}class A{A(){}}';
- testDart2Dart(src, (String s) => Expect.equals(src, s));
+ testDart2Dart('main(){new A();}class A{A(){}}');
+}
+
+testClassWithSynthesizedConstructor() {
+ testDart2Dart('main(){new A();}class A{}');
+}
+
+testClassWithMethod() {
+ testDart2Dart('main(){var a=new A(); a.foo();}class A{void foo(){}}');
}
main() {
@@ -144,5 +154,7 @@ main() {
testSimpleFileUnparse();
testSimpleObjectInstantiation();
testSimpleTopLevelClass();
+ testClassWithSynthesizedConstructor();
+ testClassWithMethod();
testTopLevelField();
}
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698