| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 'a.dart': ''' | 477 'a.dart': ''' |
| 478 class A {} | 478 class A {} |
| 479 class B {} | 479 class B {} |
| 480 class C {} | 480 class C {} |
| 481 class D = A with B, C; | 481 class D = A with B, C; |
| 482 ''', | 482 ''', |
| 483 }), | 483 }), |
| 484 | 484 |
| 485 const Test('Deferred prefix loadLibrary', const { | 485 const Test('Deferred prefix loadLibrary', const { |
| 486 'main.dart': ''' | 486 'main.dart': ''' |
| 487 import 'a.dart'; | 487 import 'a.dart'; |
| 488 | 488 |
| 489 main() { | 489 main() { |
| 490 test(); | 490 test(); |
| 491 } | 491 } |
| 492 ''', | 492 ''', |
| 493 }, preserializedSourceFiles: const { | 493 }, preserializedSourceFiles: const { |
| 494 'a.dart': ''' | 494 'a.dart': ''' |
| 495 import 'b.dart' deferred as pre; | 495 import 'b.dart' deferred as pre; |
| 496 test() { | 496 test() { |
| 497 pre.loadLibrary(); | 497 pre.loadLibrary(); |
| 498 } | 498 } |
| 499 ''', | 499 ''', |
| 500 'b.dart': ''' | 500 'b.dart': ''' |
| 501 ''', | 501 ''', |
| 502 }), | 502 }), |
| 503 |
| 504 const Test('Deferred without prefix', const { |
| 505 'main.dart': ''' |
| 506 import 'a.dart'; |
| 507 |
| 508 main() { |
| 509 test(); |
| 510 } |
| 511 ''', |
| 512 }, preserializedSourceFiles: const { |
| 513 'a.dart': ''' |
| 514 import 'b.dart' deferred; |
| 515 test() {} |
| 516 ''', |
| 517 'b.dart': ''' |
| 518 ''', |
| 519 }, expectedErrorCount: 1), |
| 520 |
| 521 const Test('Deferred with duplicate prefix', const { |
| 522 'main.dart': ''' |
| 523 import 'a.dart'; |
| 524 |
| 525 main() { |
| 526 test(); |
| 527 } |
| 528 ''', |
| 529 }, preserializedSourceFiles: const { |
| 530 'a.dart': ''' |
| 531 import 'b.dart' deferred as pre; |
| 532 import 'c.dart' deferred as pre; |
| 533 test() {} |
| 534 ''', |
| 535 'b.dart': ''' |
| 536 ''', |
| 537 'c.dart': ''' |
| 538 ''', |
| 539 }, expectedErrorCount: 1), |
| 503 ]; | 540 ]; |
| 504 | 541 |
| 505 class Test { | 542 class Test { |
| 506 final String name; | 543 final String name; |
| 507 final Map sourceFiles; | 544 final Map sourceFiles; |
| 508 final Map preserializedSourceFiles; | 545 final Map preserializedSourceFiles; |
| 509 final Map unserializedSourceFiles; | 546 final Map unserializedSourceFiles; |
| 510 final int expectedErrorCount; | 547 final int expectedErrorCount; |
| 511 final int expectedWarningCount; | 548 final int expectedWarningCount; |
| 512 final int expectedHintCount; | 549 final int expectedHintCount; |
| 513 final int expectedInfoCount; | 550 final int expectedInfoCount; |
| 514 | 551 |
| 515 const Test( | 552 const Test( |
| 516 this.name, | 553 this.name, |
| 517 this.sourceFiles, | 554 this.sourceFiles, |
| 518 {this.preserializedSourceFiles, | 555 {this.preserializedSourceFiles, |
| 519 this.unserializedSourceFiles, | 556 this.unserializedSourceFiles, |
| 520 this.expectedErrorCount: 0, | 557 this.expectedErrorCount: 0, |
| 521 this.expectedWarningCount: 0, | 558 this.expectedWarningCount: 0, |
| 522 this.expectedHintCount: 0, | 559 this.expectedHintCount: 0, |
| 523 this.expectedInfoCount: 0}); | 560 this.expectedInfoCount: 0}); |
| 524 } | 561 } |
| OLD | NEW |