| Index: pkg/analyzer/test/generated/hint_code_test.dart
|
| diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
|
| index fa3da216fadc4f776d7becfc8124e281c4ad2bae..783300a34f91e86461b576e21ef223e6e6e933df 100644
|
| --- a/pkg/analyzer/test/generated/hint_code_test.dart
|
| +++ b/pkg/analyzer/test/generated/hint_code_test.dart
|
| @@ -2838,6 +2838,60 @@ class B {}''');
|
| verify([source, source2]);
|
| }
|
|
|
| + void test_unusedShownName() {
|
| + Source source = addSource(r'''
|
| +library L;
|
| +import 'lib1.dart' show A, B;
|
| +A a;''');
|
| + Source source2 = addNamedSource(
|
| + "/lib1.dart", r'''
|
| +library lib1;
|
| +class A {}
|
| +class B {}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
|
| + assertNoErrors(source2);
|
| + verify([source, source2]);
|
| + }
|
| +
|
| + void test_unusedShownName_as() {
|
| + Source source = addSource(r'''
|
| +library L;
|
| +import 'lib1.dart' as p show A, B;
|
| +p.A a;''');
|
| + Source source2 = addNamedSource(
|
| + "/lib1.dart", r'''
|
| +library lib1;
|
| +class A {}
|
| +class B {}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
|
| + assertNoErrors(source2);
|
| + verify([source, source2]);
|
| + }
|
| +
|
| + void test_unusedShownName_duplicates() {
|
| + Source source = addSource(r'''
|
| +library L;
|
| +import 'lib1.dart' show A, B;
|
| +import 'lib1.dart' show C, D;
|
| +A a;
|
| +C c;''');
|
| + Source source2 = addNamedSource(
|
| + "/lib1.dart", r'''
|
| +library lib1;
|
| +class A {}
|
| +class B {}
|
| +class C {}
|
| +class D {}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [
|
| + HintCode.UNUSED_SHOWN_NAME,
|
| + HintCode.UNUSED_SHOWN_NAME]);
|
| + assertNoErrors(source2);
|
| + verify([source, source2]);
|
| + }
|
| +
|
| void test_unusedLocalVariable_inCatch_exception() {
|
| enableUnusedLocalVariable = true;
|
| Source source = addSource(r'''
|
|
|