| 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/engine.dart'; |
| 10 import 'package:analyzer/src/generated/source_io.dart'; | 10 import 'package:analyzer/src/generated/source_io.dart'; |
| 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 12 | 12 |
| 13 import 'resolver_test_case.dart'; | 13 import 'resolver_test_case.dart'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
| 17 defineReflectiveTests(NonHintCodeTest); | 17 defineReflectiveTests(NonHintCodeTest); |
| 18 defineReflectiveTests(NonHintCodeTest_Driver); | |
| 19 }); | 18 }); |
| 20 } | 19 } |
| 21 | 20 |
| 22 @reflectiveTest | 21 @reflectiveTest |
| 23 class NonHintCodeTest extends ResolverTestCase { | 22 class NonHintCodeTest extends ResolverTestCase { |
| 24 test_deadCode_afterTryCatch() async { | 23 test_deadCode_afterTryCatch() async { |
| 25 Source source = addSource(''' | 24 Source source = addSource(''' |
| 26 main() { | 25 main() { |
| 27 try { | 26 try { |
| 28 return f(); | 27 return f(); |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 super.test; | 1273 super.test; |
| 1275 } | 1274 } |
| 1276 } | 1275 } |
| 1277 '''); | 1276 '''); |
| 1278 await computeAnalysisResult(source); | 1277 await computeAnalysisResult(source); |
| 1279 assertNoErrors(source); | 1278 assertNoErrors(source); |
| 1280 verify([source]); | 1279 verify([source]); |
| 1281 } | 1280 } |
| 1282 } | 1281 } |
| 1283 | 1282 |
| 1284 @reflectiveTest | |
| 1285 class NonHintCodeTest_Driver extends NonHintCodeTest { | |
| 1286 @override | |
| 1287 bool get enableNewAnalysisDriver => true; | |
| 1288 } | |
| 1289 | |
| 1290 class PubSuggestionCodeTest extends ResolverTestCase { | 1283 class PubSuggestionCodeTest extends ResolverTestCase { |
| 1291 test_import_package() async { | 1284 test_import_package() async { |
| 1292 Source source = addSource("import 'package:somepackage/other.dart';"); | 1285 Source source = addSource("import 'package:somepackage/other.dart';"); |
| 1293 await computeAnalysisResult(source); | 1286 await computeAnalysisResult(source); |
| 1294 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 1287 assertErrors(source, [CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 1295 } | 1288 } |
| 1296 | 1289 |
| 1297 test_import_packageWithDotDot() async { | 1290 test_import_packageWithDotDot() async { |
| 1298 Source source = addSource("import 'package:somepackage/../other.dart';"); | 1291 Source source = addSource("import 'package:somepackage/../other.dart';"); |
| 1299 await computeAnalysisResult(source); | 1292 await computeAnalysisResult(source); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 | 1361 |
| 1369 test_import_valid_outside_lib() async { | 1362 test_import_valid_outside_lib() async { |
| 1370 addNamedSource("/myproj/pubspec.yaml", ""); | 1363 addNamedSource("/myproj/pubspec.yaml", ""); |
| 1371 addNamedSource("/myproj/web/other.dart", ""); | 1364 addNamedSource("/myproj/web/other.dart", ""); |
| 1372 Source source = | 1365 Source source = |
| 1373 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); | 1366 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); |
| 1374 await computeAnalysisResult(source); | 1367 await computeAnalysisResult(source); |
| 1375 assertNoErrors(source); | 1368 assertNoErrors(source); |
| 1376 } | 1369 } |
| 1377 } | 1370 } |
| OLD | NEW |