OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.serialization_test_data; | 5 library dart2js.serialization_test_data; |
6 | 6 |
7 const List<Test> TESTS = const <Test>[ | 7 const List<Test> TESTS = const <Test>[ |
8 const Test('Empty program', const { | 8 const Test('Empty program', const { |
9 'main.dart': 'main() {}' | 9 'main.dart': 'main() {}' |
10 }), | 10 }), |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 409 |
410 main() { | 410 main() { |
411 m(); | 411 m(); |
412 } | 412 } |
413 ''', | 413 ''', |
414 }, preserializedSourceFiles: const { | 414 }, preserializedSourceFiles: const { |
415 'a.dart': ''' | 415 'a.dart': ''' |
416 Unresolved m() {} | 416 Unresolved m() {} |
417 ''', | 417 ''', |
418 }), | 418 }), |
| 419 |
| 420 const Test('Function types for closures', const { |
| 421 'main.dart': ''' |
| 422 import 'a.dart'; |
| 423 |
| 424 typedef Func(); |
| 425 |
| 426 main(args) { |
| 427 (args.isEmpty ? new B() : new C()) is Func; |
| 428 } |
| 429 ''', |
| 430 }, preserializedSourceFiles: const { |
| 431 'a.dart': ''' |
| 432 class B { |
| 433 call(a) {} |
| 434 } |
| 435 class C { |
| 436 call() {} |
| 437 } |
| 438 ''', |
| 439 }), |
419 ]; | 440 ]; |
420 | 441 |
421 class Test { | 442 class Test { |
422 final String name; | 443 final String name; |
423 final Map sourceFiles; | 444 final Map sourceFiles; |
424 final Map preserializedSourceFiles; | 445 final Map preserializedSourceFiles; |
425 final Map unserializedSourceFiles; | 446 final Map unserializedSourceFiles; |
426 final int expectedErrorCount; | 447 final int expectedErrorCount; |
427 final int expectedWarningCount; | 448 final int expectedWarningCount; |
428 final int expectedHintCount; | 449 final int expectedHintCount; |
429 final int expectedInfoCount; | 450 final int expectedInfoCount; |
430 | 451 |
431 const Test( | 452 const Test( |
432 this.name, | 453 this.name, |
433 this.sourceFiles, | 454 this.sourceFiles, |
434 {this.preserializedSourceFiles, | 455 {this.preserializedSourceFiles, |
435 this.unserializedSourceFiles, | 456 this.unserializedSourceFiles, |
436 this.expectedErrorCount: 0, | 457 this.expectedErrorCount: 0, |
437 this.expectedWarningCount: 0, | 458 this.expectedWarningCount: 0, |
438 this.expectedHintCount: 0, | 459 this.expectedHintCount: 0, |
439 this.expectedInfoCount: 0}); | 460 this.expectedInfoCount: 0}); |
440 } | 461 } |
OLD | NEW |