| 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 analyzer.test.generated.non_hint_code_test; | 5 library analyzer.test.generated.non_hint_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/src/error/codes.dart'; | 8 import 'package:analyzer/src/error/codes.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; |
| 9 import 'package:analyzer/src/generated/source_io.dart'; | 10 import 'package:analyzer/src/generated/source_io.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 11 | 12 |
| 12 import 'resolver_test_case.dart'; | 13 import 'resolver_test_case.dart'; |
| 13 | 14 |
| 14 main() { | 15 main() { |
| 15 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(NonHintCodeTest); | 17 defineReflectiveTests(NonHintCodeTest); |
| 17 }); | 18 }); |
| 18 } | 19 } |
| 19 | 20 |
| 20 @reflectiveTest | 21 @reflectiveTest |
| 21 class NonHintCodeTest extends ResolverTestCase { | 22 class NonHintCodeTest extends ResolverTestCase { |
| 23 void test_() { |
| 24 resetWithOptions(new AnalysisOptionsImpl()..enableSuperMixins = true); |
| 25 Source source = addSource(r''' |
| 26 abstract class A { |
| 27 void test(); |
| 28 } |
| 29 class B extends A { |
| 30 void test() { |
| 31 super.test; |
| 32 } |
| 33 } |
| 34 '''); |
| 35 computeLibrarySourceErrors(source); |
| 36 assertNoErrors(source); |
| 37 verify([source]); |
| 38 } |
| 39 |
| 22 void test_deadCode_afterTryCatch() { | 40 void test_deadCode_afterTryCatch() { |
| 23 Source source = addSource(''' | 41 Source source = addSource(''' |
| 24 main() { | 42 main() { |
| 25 try { | 43 try { |
| 26 return f(); | 44 return f(); |
| 27 } catch (e) { | 45 } catch (e) { |
| 28 print(e); | 46 print(e); |
| 29 } | 47 } |
| 30 print('not dead'); | 48 print('not dead'); |
| 31 } | 49 } |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 | 1358 |
| 1341 void test_import_valid_outside_lib() { | 1359 void test_import_valid_outside_lib() { |
| 1342 cacheSource("/myproj/pubspec.yaml", ""); | 1360 cacheSource("/myproj/pubspec.yaml", ""); |
| 1343 cacheSource("/myproj/web/other.dart", ""); | 1361 cacheSource("/myproj/web/other.dart", ""); |
| 1344 Source source = | 1362 Source source = |
| 1345 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); | 1363 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); |
| 1346 computeLibrarySourceErrors(source); | 1364 computeLibrarySourceErrors(source); |
| 1347 assertNoErrors(source); | 1365 assertNoErrors(source); |
| 1348 } | 1366 } |
| 1349 } | 1367 } |
| OLD | NEW |