Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import("../../../lib/compiler/compiler.dart"); | 7 #import("../../../lib/compiler/compiler.dart"); |
| 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| 9 | 9 |
| 10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 | 125 |
| 126 testSimpleObjectInstantiation() { | 126 testSimpleObjectInstantiation() { |
| 127 testUnparse('main(){new Object();}'); | 127 testUnparse('main(){new Object();}'); |
| 128 } | 128 } |
| 129 | 129 |
| 130 testSimpleTopLevelClass() { | 130 testSimpleTopLevelClass() { |
| 131 final src = 'main(){new A();}class A{A(){}}'; | 131 final src = 'main(){new A();}class A{A(){}}'; |
| 132 testDart2Dart(src, (String s) => Expect.equals(src, s)); | 132 testDart2Dart(src, (String s) => Expect.equals(src, s)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 testClassWithSynthesizedConstructor() { | |
| 136 final src = 'main(){new A();}class A{}'; | |
| 137 testDart2Dart(src, (String s) => Expect.equals(src, s)); | |
|
Anton Muhin
2012/07/10 13:27:46
definitely the time to introduce a helper which ch
Roman
2012/07/10 13:47:16
Done. If no continuation is passed to testDart2Dar
| |
| 138 } | |
| 139 | |
| 140 testClassWithMethod() { | |
| 141 final src = 'main(){var a=new A(); a.foo();}class A{void foo(){}}'; | |
| 142 testDart2Dart(src, (String s) => Expect.equals(src, s)); | |
| 143 } | |
| 144 | |
| 135 main() { | 145 main() { |
| 136 testGenericTypes(); | 146 testGenericTypes(); |
| 137 testForLoop(); | 147 testForLoop(); |
| 138 testEmptyList(); | 148 testEmptyList(); |
| 139 testClosure(); | 149 testClosure(); |
| 140 testIndexedOperatorDecl(); | 150 testIndexedOperatorDecl(); |
| 141 testNativeMethods(); | 151 testNativeMethods(); |
| 142 testPrefixIncrements(); | 152 testPrefixIncrements(); |
| 143 testConstModifier(); | 153 testConstModifier(); |
| 144 testSimpleFileUnparse(); | 154 testSimpleFileUnparse(); |
| 145 testSimpleObjectInstantiation(); | 155 testSimpleObjectInstantiation(); |
| 146 testSimpleTopLevelClass(); | 156 testSimpleTopLevelClass(); |
| 157 testClassWithSynthesizedConstructor(); | |
| 158 testClassWithMethod(); | |
| 147 testTopLevelField(); | 159 testTopLevelField(); |
| 148 } | 160 } |
| OLD | NEW |