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 // This test is very long-running and put here first to compile it on its own |
| 9 // in compilation0_test.dart |
| 10 const Test('Disable tree shaking through reflection', const { |
| 11 'main.dart': ''' |
| 12 import 'dart:mirrors'; |
| 13 |
| 14 main() { |
| 15 reflect(null).invoke(#toString, []).reflectee; |
| 16 } |
| 17 ''', |
| 18 }, expectedWarningCount: 1), |
| 19 |
8 const Test('Empty program', const { | 20 const Test('Empty program', const { |
9 'main.dart': 'main() {}' | 21 'main.dart': 'main() {}' |
10 }), | 22 }), |
11 | 23 |
12 const Test('Hello World', const { | 24 const Test('Hello World', const { |
13 'main.dart': 'main() => print("Hello World");' | 25 'main.dart': 'main() => print("Hello World");' |
14 }), | 26 }), |
15 | 27 |
16 const Test('Too many arguments to print', const { | 28 const Test('Too many arguments to print', const { |
17 'main.dart': 'main() => print("Hello World", 0);' | 29 'main.dart': 'main() => print("Hello World", 0);' |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void foo() {} | 381 void foo() {} |
370 ''', | 382 ''', |
371 }), | 383 }), |
372 | 384 |
373 const Test('fromEnvironment constants', const { | 385 const Test('fromEnvironment constants', const { |
374 'main.dart': ''' | 386 'main.dart': ''' |
375 main() => const String.fromEnvironment("foo"); | 387 main() => const String.fromEnvironment("foo"); |
376 ''', | 388 ''', |
377 }), | 389 }), |
378 | 390 |
379 const Test('Disable tree shaking through reflection', const { | |
380 'main.dart': ''' | |
381 import 'dart:mirrors'; | |
382 | |
383 main() { | |
384 reflect(null).invoke(#toString, []).reflectee; | |
385 } | |
386 ''', | |
387 }, expectedWarningCount: 1), | |
388 | |
389 const Test('Unused noSuchMethod', const { | 391 const Test('Unused noSuchMethod', const { |
390 'main.dart': ''' | 392 'main.dart': ''' |
391 import 'a.dart'; | 393 import 'a.dart'; |
392 | 394 |
393 main() { | 395 main() { |
394 new A().m(); | 396 new A().m(); |
395 } | 397 } |
396 ''', | 398 ''', |
397 }, preserializedSourceFiles: const { | 399 }, preserializedSourceFiles: const { |
398 'a.dart': ''' | 400 'a.dart': ''' |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 const Test( | 561 const Test( |
560 this.name, | 562 this.name, |
561 this.sourceFiles, | 563 this.sourceFiles, |
562 {this.preserializedSourceFiles, | 564 {this.preserializedSourceFiles, |
563 this.unserializedSourceFiles, | 565 this.unserializedSourceFiles, |
564 this.expectedErrorCount: 0, | 566 this.expectedErrorCount: 0, |
565 this.expectedWarningCount: 0, | 567 this.expectedWarningCount: 0, |
566 this.expectedHintCount: 0, | 568 this.expectedHintCount: 0, |
567 this.expectedInfoCount: 0}); | 569 this.expectedInfoCount: 0}); |
568 } | 570 } |
OLD | NEW |