Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 1850813002: Issue dartdoc#1124. Get used elements from directive comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.hint_code_test; 5 library analyzer.test.generated.hint_code_test;
6 6
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/error.dart'; 8 import 'package:analyzer/src/generated/error.dart';
9 import 'package:analyzer/src/generated/source_io.dart'; 9 import 'package:analyzer/src/generated/source_io.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 "/lib1.dart", 2702 "/lib1.dart",
2703 r''' 2703 r'''
2704 library lib1; 2704 library lib1;
2705 class A {}'''); 2705 class A {}''');
2706 computeLibrarySourceErrors(source); 2706 computeLibrarySourceErrors(source);
2707 assertErrors(source, [HintCode.UNUSED_IMPORT]); 2707 assertErrors(source, [HintCode.UNUSED_IMPORT]);
2708 assertNoErrors(source2); 2708 assertNoErrors(source2);
2709 verify([source, source2]); 2709 verify([source, source2]);
2710 } 2710 }
2711 2711
2712 void test_unusedImport_inComment_libraryDirective() {
2713 Source source = addSource(r'''
2714 /// Use [Future] class.
2715 library L;
2716 import 'dart:async';
2717 ''');
2718 assertNoErrors(source);
2719 }
2720
2712 void test_unusedImport_show() { 2721 void test_unusedImport_show() {
2713 Source source = addSource(r''' 2722 Source source = addSource(r'''
2714 library L; 2723 library L;
2715 import 'lib1.dart' show A; 2724 import 'lib1.dart' show A;
2716 import 'lib1.dart' show B; 2725 import 'lib1.dart' show B;
2717 A a;'''); 2726 A a;''');
2718 Source source2 = addNamedSource( 2727 Source source2 = addNamedSource(
2719 "/lib1.dart", 2728 "/lib1.dart",
2720 r''' 2729 r'''
2721 library lib1; 2730 library lib1;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2988 n() { 2997 n() {
2989 var a = m(), b = m(); 2998 var a = m(), b = m();
2990 } 2999 }
2991 }'''); 3000 }''');
2992 computeLibrarySourceErrors(source); 3001 computeLibrarySourceErrors(source);
2993 assertErrors( 3002 assertErrors(
2994 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); 3003 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]);
2995 verify([source]); 3004 verify([source]);
2996 } 3005 }
2997 } 3006 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698