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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 const Test('Disable tree shaking through reflection', const { | 379 const Test('Disable tree shaking through reflection', const { |
380 'main.dart': ''' | 380 'main.dart': ''' |
381 import 'dart:mirrors'; | 381 import 'dart:mirrors'; |
382 | 382 |
383 main() { | 383 main() { |
384 reflect(null).invoke(#toString, []).reflectee; | 384 reflect(null).invoke(#toString, []).reflectee; |
385 } | 385 } |
386 ''', | 386 ''', |
387 }, expectedWarningCount: 1), | 387 }, expectedWarningCount: 1), |
| 388 |
| 389 const Test('Unused noSuchMethod', const { |
| 390 'main.dart': ''' |
| 391 import 'a.dart'; |
| 392 |
| 393 main() { |
| 394 new A().m(); |
| 395 } |
| 396 ''', |
| 397 }, preserializedSourceFiles: const { |
| 398 'a.dart': ''' |
| 399 class A { |
| 400 noSuchMethod(_) => null; |
| 401 m(); |
| 402 } |
| 403 ''', |
| 404 }), |
388 ]; | 405 ]; |
389 | 406 |
390 class Test { | 407 class Test { |
391 final String name; | 408 final String name; |
392 final Map sourceFiles; | 409 final Map sourceFiles; |
393 final Map preserializedSourceFiles; | 410 final Map preserializedSourceFiles; |
394 final Map unserializedSourceFiles; | 411 final Map unserializedSourceFiles; |
395 final int expectedErrorCount; | 412 final int expectedErrorCount; |
396 final int expectedWarningCount; | 413 final int expectedWarningCount; |
397 final int expectedHintCount; | 414 final int expectedHintCount; |
398 final int expectedInfoCount; | 415 final int expectedInfoCount; |
399 | 416 |
400 const Test( | 417 const Test( |
401 this.name, | 418 this.name, |
402 this.sourceFiles, | 419 this.sourceFiles, |
403 {this.preserializedSourceFiles, | 420 {this.preserializedSourceFiles, |
404 this.unserializedSourceFiles, | 421 this.unserializedSourceFiles, |
405 this.expectedErrorCount: 0, | 422 this.expectedErrorCount: 0, |
406 this.expectedWarningCount: 0, | 423 this.expectedWarningCount: 0, |
407 this.expectedHintCount: 0, | 424 this.expectedHintCount: 0, |
408 this.expectedInfoCount: 0}); | 425 this.expectedInfoCount: 0}); |
409 } | 426 } |
OLD | NEW |