Skip to content

Commit c68fd58

Browse files
srawlinscommit-bot@chromium.org
authored andcommitted
Use ///-style doc comments in analyzer/test
Bug: #33892 Change-Id: If61e07fda4d74b1e5171d22403b156855cd00596 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152701 Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 48608ce commit c68fd58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+727
-1274
lines changed

pkg/analyzer/test/dart/ast/ast_test.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,12 +1053,11 @@ class SimpleIdentifierTest extends ParserTestCase {
10531053
return identifier;
10541054
}
10551055

1056-
/**
1057-
* Return the top-most node in the AST structure containing the given identifier.
1058-
*
1059-
* @param identifier the identifier in the AST structure being traversed
1060-
* @return the root of the AST structure containing the identifier
1061-
*/
1056+
/// Return the top-most node in the AST structure containing the given
1057+
/// identifier.
1058+
///
1059+
/// @param identifier the identifier in the AST structure being traversed
1060+
/// @return the root of the AST structure containing the identifier
10621061
AstNode _topMostNode(SimpleIdentifier identifier) {
10631062
AstNode child = identifier;
10641063
AstNode parent = identifier.parent;

pkg/analyzer/test/dart/ast/visitor_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ A f(var p) {
5252
}
5353
}
5454

55-
/**
56-
* A helper class used to collect the nodes that were visited and to preserve
57-
* the order in which they were visited.
58-
*/
55+
/// A helper class used to collect the nodes that were visited and to preserve
56+
/// the order in which they were visited.
5957
class _BreadthFirstVisitorTestHelper extends BreadthFirstVisitor<void> {
6058
List<AstNode> nodes;
6159

pkg/analyzer/test/file_system/file_system_test_support.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,7 @@ mixin FolderTestMixin implements FileSystemTestSupport {
617617
expect(folder.toUri(), Uri.directory(defaultFolderPath));
618618
}
619619

620-
/**
621-
* Verify that the [copy] has the same name and content as the [source].
622-
*/
620+
/// Verify that the [copy] has the same name and content as the [source].
623621
void _verifyStructure(Folder copy, Folder source) {
624622
expect(copy.shortName, source.shortName);
625623
Map<String, File> sourceFiles = <String, File>{};

pkg/analyzer/test/file_system/overlay_file_system_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,7 @@ class FolderTest extends OverlayTestSupport {
631631
expect(folder.resolveSymbolicLinksSync(), folder);
632632
}
633633

634-
/**
635-
* Verify that the [copy] has the same name and content as the [source].
636-
*/
634+
/// Verify that the [copy] has the same name and content as the [source].
637635
void _verifyStructure(Folder copy, Folder source) {
638636
expect(copy.shortName, source.shortName);
639637
Map<String, File> sourceFiles = <String, File>{};

pkg/analyzer/test/generated/element_resolver_test.dart

Lines changed: 54 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -297,29 +297,19 @@ class C {}
297297

298298
@reflectiveTest
299299
class ElementResolverTest with ResourceProviderMixin, ElementsTypesMixin {
300-
/**
301-
* The error listener to which errors will be reported.
302-
*/
300+
/// The error listener to which errors will be reported.
303301
GatheringErrorListener _listener;
304302

305-
/**
306-
* The type provider used to access the types.
307-
*/
303+
/// The type provider used to access the types.
308304
TypeProvider _typeProvider;
309305

310-
/**
311-
* The library containing the code being resolved.
312-
*/
306+
/// The library containing the code being resolved.
313307
LibraryElementImpl _definingLibrary;
314308

315-
/**
316-
* The resolver visitor that maintains the state for the resolver.
317-
*/
309+
/// The resolver visitor that maintains the state for the resolver.
318310
ResolverVisitor _visitor;
319311

320-
/**
321-
* The resolver being used to resolve the test cases.
322-
*/
312+
/// The resolver being used to resolve the test cases.
323313
ElementResolver _resolver;
324314

325315
@override
@@ -960,9 +950,7 @@ class ElementResolverTest with ResourceProviderMixin, ElementsTypesMixin {
960950
_listener.assertNoErrors();
961951
}
962952

963-
/**
964-
* Create and return the resolver used by the tests.
965-
*/
953+
/// Create and return the resolver used by the tests.
966954
void _createResolver() {
967955
var context = TestAnalysisContext();
968956
_typeProvider = context.typeProviderLegacy;
@@ -991,56 +979,50 @@ class ElementResolverTest with ResourceProviderMixin, ElementsTypesMixin {
991979
}
992980
}
993981

994-
/**
995-
* Return the element associated with the label of [statement] after the
996-
* resolver has resolved it. [labelElement] is the label element to be
997-
* defined in the statement's label scope, and [labelTarget] is the statement
998-
* the label resolves to.
999-
*/
982+
/// Return the element associated with the label of [statement] after the
983+
/// resolver has resolved it. [labelElement] is the label element to be
984+
/// defined in the statement's label scope, and [labelTarget] is the statement
985+
/// the label resolves to.
1000986
Element _resolveBreak(BreakStatement statement, LabelElementImpl labelElement,
1001987
Statement labelTarget) {
1002988
_resolveStatement(statement, labelElement, labelTarget);
1003989
return statement.label.staticElement;
1004990
}
1005991

1006-
/**
1007-
* Return the element associated with the label [statement] after the
1008-
* resolver has resolved it. [labelElement] is the label element to be
1009-
* defined in the statement's label scope, and [labelTarget] is the AST node
1010-
* the label resolves to.
1011-
*
1012-
* @param statement the statement to be resolved
1013-
* @param labelElement the label element to be defined in the statement's label scope
1014-
* @return the element to which the statement's label was resolved
1015-
*/
992+
/// Return the element associated with the label [statement] after the
993+
/// resolver has resolved it. [labelElement] is the label element to be
994+
/// defined in the statement's label scope, and [labelTarget] is the AST node
995+
/// the label resolves to.
996+
///
997+
/// @param statement the statement to be resolved
998+
/// @param labelElement the label element to be defined in the statement's
999+
/// label scope
1000+
/// @return the element to which the statement's label was resolved
10161001
Element _resolveContinue(ContinueStatement statement,
10171002
LabelElementImpl labelElement, AstNode labelTarget) {
10181003
_resolveStatement(statement, labelElement, labelTarget);
10191004
return statement.label.staticElement;
10201005
}
10211006

1022-
/**
1023-
* Return the element associated with the given identifier after the resolver has resolved the
1024-
* identifier.
1025-
*
1026-
* @param node the expression to be resolved
1027-
* @param definedElements the elements that are to be defined in the scope in which the element is
1028-
* being resolved
1029-
* @return the element to which the expression was resolved
1030-
*/
1007+
/// Return the element associated with the given identifier after the resolver
1008+
/// has resolved the identifier.
1009+
///
1010+
/// @param node the expression to be resolved
1011+
/// @param definedElements the elements that are to be defined in the scope in
1012+
/// which the element is being resolved
1013+
/// @return the element to which the expression was resolved
10311014
Element _resolveIdentifier(Identifier node, [List<Element> definedElements]) {
10321015
_resolveNode(node, definedElements);
10331016
return node.staticElement;
10341017
}
10351018

1036-
/**
1037-
* Return the element associated with the given identifier after the resolver has resolved the
1038-
* identifier.
1039-
*
1040-
* @param node the expression to be resolved
1041-
* @param enclosingClass the element representing the class enclosing the identifier
1042-
* @return the element to which the expression was resolved
1043-
*/
1019+
/// Return the element associated with the given identifier after the resolver
1020+
/// has resolved the identifier.
1021+
///
1022+
/// @param node the expression to be resolved
1023+
/// @param enclosingClass the element representing the class enclosing the
1024+
/// identifier
1025+
/// @return the element to which the expression was resolved
10441026
void _resolveInClass(AstNode node, ClassElement enclosingClass) {
10451027
Scope outerScope = _visitor.nameScope;
10461028
try {
@@ -1055,30 +1037,26 @@ class ElementResolverTest with ResourceProviderMixin, ElementsTypesMixin {
10551037
}
10561038
}
10571039

1058-
/**
1059-
* Return the element associated with the given expression after the resolver has resolved the
1060-
* expression.
1061-
*
1062-
* @param node the expression to be resolved
1063-
* @param definedElements the elements that are to be defined in the scope in which the element is
1064-
* being resolved
1065-
* @return the element to which the expression was resolved
1066-
*/
1040+
/// Return the element associated with the given expression after the resolver
1041+
/// has resolved the expression.
1042+
///
1043+
/// @param node the expression to be resolved
1044+
/// @param definedElements the elements that are to be defined in the scope in
1045+
/// which the element is being resolved
1046+
/// @return the element to which the expression was resolved
10671047
Element _resolveIndexExpression(IndexExpression node,
10681048
[List<Element> definedElements]) {
10691049
_resolveNode(node, definedElements);
10701050
return node.staticElement;
10711051
}
10721052

1073-
/**
1074-
* Return the element associated with the given identifier after the resolver has resolved the
1075-
* identifier.
1076-
*
1077-
* @param node the expression to be resolved
1078-
* @param definedElements the elements that are to be defined in the scope in which the element is
1079-
* being resolved
1080-
* @return the element to which the expression was resolved
1081-
*/
1053+
/// Return the element associated with the given identifier after the resolver
1054+
/// has resolved the identifier.
1055+
///
1056+
/// @param node the expression to be resolved
1057+
/// @param definedElements the elements that are to be defined in the scope in
1058+
/// which the element is being resolved
1059+
/// @return the element to which the expression was resolved
10821060
void _resolveNode(AstNode node, [List<Element> definedElements]) {
10831061
Scope outerScope = _visitor.nameScope;
10841062
try {
@@ -1095,14 +1073,13 @@ class ElementResolverTest with ResourceProviderMixin, ElementsTypesMixin {
10951073
}
10961074
}
10971075

1098-
/**
1099-
* Return the element associated with the label of the given statement after the resolver has
1100-
* resolved the statement.
1101-
*
1102-
* @param statement the statement to be resolved
1103-
* @param labelElement the label element to be defined in the statement's label scope
1104-
* @return the element to which the statement's label was resolved
1105-
*/
1076+
/// Return the element associated with the label of the given statement after
1077+
/// the resolver has resolved the statement.
1078+
///
1079+
/// @param statement the statement to be resolved
1080+
/// @param labelElement the label element to be defined in the statement's
1081+
/// label scope
1082+
/// @return the element to which the statement's label was resolved
11061083
void _resolveStatement(
11071084
Statement statement, LabelElementImpl labelElement, AstNode labelTarget) {
11081085
LabelScope outerScope = _visitor.labelScope;

pkg/analyzer/test/generated/parser_fasta_listener.dart

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,25 @@ import 'package:_fe_analyzer_shared/src/parser/parser.dart';
88
import 'package:_fe_analyzer_shared/src/scanner/token.dart';
99
import 'package:test/test.dart';
1010

11-
/**
12-
* Proxy implementation of the fasta parser listener that
13-
* asserts begin/end pairs of events and forwards all events
14-
* to the specified listener.
15-
*
16-
* When `parseUnit` is called, then all events are generated as expected.
17-
* When "lower level" parse methods are called, then some "higher level"
18-
* begin/end event pairs will not be generated. In this case,
19-
* construct a new listener and call `begin('higher-level-event')`
20-
* before calling the "lower level" parse method. Once the parse method returns,
21-
* call `end('higher-level-event')` to assert that the stack is in the
22-
* expected state.
23-
*
24-
* For example, when calling `parseTopLevelDeclaration`, the
25-
* [beginCompilationUnit] and [endCompilationUnit] event pair is not generated.
26-
* In this case, call `begin('CompilationUnit')` before calling
27-
* `parseTopLevelDeclaration`, and call `end('CompilationUnit')` afterward.
28-
*
29-
* When calling `parseUnit`, do not call `begin` or `end`,
30-
* but call `expectEmpty` after `parseUnit` returns.
31-
*/
11+
/// Proxy implementation of the fasta parser listener that
12+
/// asserts begin/end pairs of events and forwards all events
13+
/// to the specified listener.
14+
///
15+
/// When `parseUnit` is called, then all events are generated as expected.
16+
/// When "lower level" parse methods are called, then some "higher level"
17+
/// begin/end event pairs will not be generated. In this case,
18+
/// construct a new listener and call `begin('higher-level-event')`
19+
/// before calling the "lower level" parse method. Once the parse method
20+
/// returns, call `end('higher-level-event')` to assert that the stack is in the
21+
/// expected state.
22+
///
23+
/// For example, when calling `parseTopLevelDeclaration`, the
24+
/// [beginCompilationUnit] and [endCompilationUnit] event pair is not generated.
25+
/// In this case, call `begin('CompilationUnit')` before calling
26+
/// `parseTopLevelDeclaration`, and call `end('CompilationUnit')` afterward.
27+
///
28+
/// When calling `parseUnit`, do not call `begin` or `end`,
29+
/// but call `expectEmpty` after `parseUnit` returns.
3230
class ForwardingTestListener extends ForwardingListener {
3331
final _stack = <String>[];
3432

0 commit comments

Comments
 (0)