| 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
| 7 import 'mock_compiler.dart'; | 7 import 'mock_compiler.dart'; |
| 8 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; | 8 import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart'; |
| 9 | 9 |
| 10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 "external const factory Foo() = prefix.Bar<List<T>,T>.baz;"); | 276 "external const factory Foo() = prefix.Bar<List<T>,T>.baz;"); |
| 277 } | 277 } |
| 278 | 278 |
| 279 testClassDeclarations() { | 279 testClassDeclarations() { |
| 280 testUnparseTopLevelWithMetadata('class Foo{}'); | 280 testUnparseTopLevelWithMetadata('class Foo{}'); |
| 281 testUnparseTopLevelWithMetadata('abstract class Foo{}'); | 281 testUnparseTopLevelWithMetadata('abstract class Foo{}'); |
| 282 testUnparseTopLevelWithMetadata('class Fisk{operator-(x){}}'); | 282 testUnparseTopLevelWithMetadata('class Fisk{operator-(x){}}'); |
| 283 } | 283 } |
| 284 | 284 |
| 285 testMixinApplications() { | 285 testMixinApplications() { |
| 286 testUnparseTopLevelWithMetadata('typedef C = S with M;'); | 286 testUnparseTopLevelWithMetadata('class C = S with M;'); |
| 287 testUnparseTopLevelWithMetadata('typedef C = S with M1,M2;'); | 287 testUnparseTopLevelWithMetadata('class C = S with M1,M2;'); |
| 288 testUnparseTopLevelWithMetadata('typedef C = S with M1,M2,M3;'); | 288 testUnparseTopLevelWithMetadata('class C = S with M1,M2,M3;'); |
| 289 | 289 |
| 290 testUnparseTopLevelWithMetadata('typedef C<A> = S with M;'); | 290 testUnparseTopLevelWithMetadata('class C<A> = S with M;'); |
| 291 testUnparseTopLevelWithMetadata('typedef C<A,B> = S with M;'); | 291 testUnparseTopLevelWithMetadata('class C<A,B> = S with M;'); |
| 292 | 292 |
| 293 testUnparseTopLevelWithMetadata('typedef C = S<A> with M;'); | 293 testUnparseTopLevelWithMetadata('class C = S<A> with M;'); |
| 294 testUnparseTopLevelWithMetadata('typedef C = S<A,B> with M;'); | 294 testUnparseTopLevelWithMetadata('class C = S<A,B> with M;'); |
| 295 | 295 |
| 296 testUnparseTopLevelWithMetadata('typedef C = S with M<A>;'); | 296 testUnparseTopLevelWithMetadata('class C = S with M<A>;'); |
| 297 testUnparseTopLevelWithMetadata('typedef C = S with M<A,B>;'); | 297 testUnparseTopLevelWithMetadata('class C = S with M<A,B>;'); |
| 298 testUnparseTopLevelWithMetadata('typedef C = S with M1<A>,M2;'); | 298 testUnparseTopLevelWithMetadata('class C = S with M1<A>,M2;'); |
| 299 testUnparseTopLevelWithMetadata('typedef C = S with M1,M2<A,B>;'); | 299 testUnparseTopLevelWithMetadata('class C = S with M1,M2<A,B>;'); |
| 300 |
| 301 testUnparseTopLevelWithMetadata('abstract class C = S with M;'); |
| 302 testUnparseTopLevelWithMetadata('abstract class C<A> = S<A> with M<A>;'); |
| 300 } | 303 } |
| 301 | 304 |
| 302 testUnparseParameters(List<String> variableDeclarations) { | 305 testUnparseParameters(List<String> variableDeclarations) { |
| 303 var sb = new StringBuffer(); | 306 var sb = new StringBuffer(); |
| 304 sb.write('Constructor('); | 307 sb.write('Constructor('); |
| 305 int index = 0; | 308 int index = 0; |
| 306 for (String variableDeclaration in variableDeclarations) { | 309 for (String variableDeclaration in variableDeclarations) { |
| 307 if (index != 0) { | 310 if (index != 0) { |
| 308 sb.write(', '); | 311 sb.write(', '); |
| 309 } | 312 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 testExport(); | 377 testExport(); |
| 375 testPart(); | 378 testPart(); |
| 376 testPartOf(); | 379 testPartOf(); |
| 377 testCombinators(); | 380 testCombinators(); |
| 378 testRedirectingFactoryConstructors(); | 381 testRedirectingFactoryConstructors(); |
| 379 testClassDeclarations(); | 382 testClassDeclarations(); |
| 380 testMixinApplications(); | 383 testMixinApplications(); |
| 381 testParameters(); | 384 testParameters(); |
| 382 testSymbolLiterals(); | 385 testSymbolLiterals(); |
| 383 } | 386 } |
| OLD | NEW |