-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove EngineTestCase.assertInstanceOf and extract ast/element TypeMa…
…tcher(s). [email protected] Change-Id: I9c47b4a7426dccafb8d3ffc1b0652da0106f2184 Reviewed-on: https://dart-review.googlesource.com/c/87302 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
- Loading branch information
1 parent
fa181d9
commit 162d0d1
Showing
14 changed files
with
733 additions
and
882 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
pkg/analyzer/lib/src/test_utilities/ast_type_matchers.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:analyzer/dart/ast/ast.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
const isAsExpression = const TypeMatcher<AsExpression>(); | ||
|
||
const isAssertInitializer = const TypeMatcher<AssertInitializer>(); | ||
|
||
const isAssignmentExpression = const TypeMatcher<AssignmentExpression>(); | ||
|
||
const isAwaitExpression = const TypeMatcher<AwaitExpression>(); | ||
|
||
const isBinaryExpression = const TypeMatcher<BinaryExpression>(); | ||
|
||
const isBlock = const TypeMatcher<Block>(); | ||
|
||
const isBlockFunctionBody = const TypeMatcher<BlockFunctionBody>(); | ||
|
||
const isClassDeclaration = const TypeMatcher<ClassDeclaration>(); | ||
|
||
const isClassTypeAlias = const TypeMatcher<ClassTypeAlias>(); | ||
|
||
const isCompilationUnit = const TypeMatcher<CompilationUnit>(); | ||
|
||
const isConditionalExpression = const TypeMatcher<ConditionalExpression>(); | ||
|
||
const isConstructorDeclaration = const TypeMatcher<ConstructorDeclaration>(); | ||
|
||
const isConstructorFieldInitializer = | ||
const TypeMatcher<ConstructorFieldInitializer>(); | ||
|
||
const isDefaultFormalParameter = const TypeMatcher<DefaultFormalParameter>(); | ||
|
||
const isEmptyFunctionBody = const TypeMatcher<EmptyFunctionBody>(); | ||
|
||
const isEmptyStatement = const TypeMatcher<EmptyStatement>(); | ||
|
||
const isExpressionFunctionBody = const TypeMatcher<ExpressionFunctionBody>(); | ||
|
||
const isExpressionStatement = const TypeMatcher<ExpressionStatement>(); | ||
|
||
const isFieldDeclaration = const TypeMatcher<FieldDeclaration>(); | ||
|
||
const isFieldFormalParameter = const TypeMatcher<FieldFormalParameter>(); | ||
|
||
const isForStatement = const TypeMatcher<ForStatement>(); | ||
|
||
const isFunctionDeclaration = const TypeMatcher<FunctionDeclaration>(); | ||
|
||
const isFunctionDeclarationStatement = | ||
const TypeMatcher<FunctionDeclarationStatement>(); | ||
|
||
const isFunctionExpression = const TypeMatcher<FunctionExpression>(); | ||
|
||
const isFunctionTypeAlias = const TypeMatcher<FunctionTypeAlias>(); | ||
|
||
const isFunctionTypedFormalParameter = | ||
const TypeMatcher<FunctionTypedFormalParameter>(); | ||
|
||
const isGenericFunctionType = const TypeMatcher<GenericFunctionType>(); | ||
|
||
const isIndexExpression = const TypeMatcher<IndexExpression>(); | ||
|
||
const isInstanceCreationExpression = | ||
const TypeMatcher<InstanceCreationExpression>(); | ||
|
||
const isIntegerLiteral = const TypeMatcher<IntegerLiteral>(); | ||
|
||
const isInterpolationExpression = const TypeMatcher<InterpolationExpression>(); | ||
|
||
const isInterpolationString = const TypeMatcher<InterpolationString>(); | ||
|
||
const isIsExpression = const TypeMatcher<IsExpression>(); | ||
|
||
const isLibraryDirective = const TypeMatcher<LibraryDirective>(); | ||
|
||
const isMethodDeclaration = const TypeMatcher<MethodDeclaration>(); | ||
|
||
const isMethodInvocation = const TypeMatcher<MethodInvocation>(); | ||
|
||
const isNullLiteral = const TypeMatcher<NullLiteral>(); | ||
|
||
const isParenthesizedExpression = const TypeMatcher<ParenthesizedExpression>(); | ||
|
||
const isPrefixedIdentifier = const TypeMatcher<PrefixedIdentifier>(); | ||
|
||
const isPrefixExpression = const TypeMatcher<PrefixExpression>(); | ||
|
||
const isPropertyAccess = const TypeMatcher<PropertyAccess>(); | ||
|
||
const isReturnStatement = const TypeMatcher<ReturnStatement>(); | ||
|
||
const isSimpleFormalParameter = const TypeMatcher<SimpleFormalParameter>(); | ||
|
||
const isSimpleIdentifier = const TypeMatcher<SimpleIdentifier>(); | ||
|
||
const isStringInterpolation = const TypeMatcher<StringInterpolation>(); | ||
|
||
const isSuperExpression = const TypeMatcher<SuperExpression>(); | ||
|
||
const isTopLevelVariableDeclaration = | ||
const TypeMatcher<TopLevelVariableDeclaration>(); | ||
|
||
const isTypeName = const TypeMatcher<TypeName>(); | ||
|
||
const isVariableDeclarationStatement = | ||
const TypeMatcher<VariableDeclarationStatement>(); |
30 changes: 30 additions & 0 deletions
30
pkg/analyzer/lib/src/test_utilities/element_type_matchers.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:analyzer/dart/element/element.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
const isClassElement = const TypeMatcher<ClassElement>(); | ||
|
||
const isCompilationUnitElement = const TypeMatcher<CompilationUnitElement>(); | ||
|
||
const isConstructorElement = const TypeMatcher<ConstructorElement>(); | ||
|
||
const isExportElement = const TypeMatcher<ExportElement>(); | ||
|
||
const isFieldElement = const TypeMatcher<FieldElement>(); | ||
|
||
const isFunctionElement = const TypeMatcher<FunctionElement>(); | ||
|
||
const isImportElement = const TypeMatcher<ImportElement>(); | ||
|
||
const isLibraryElement = const TypeMatcher<LibraryElement>(); | ||
|
||
const isMethodElement = const TypeMatcher<MethodElement>(); | ||
|
||
const isPropertyAccessorElement = const TypeMatcher<PropertyAccessorElement>(); | ||
|
||
const isPropertyInducingElement = const TypeMatcher<PropertyInducingElement>(); | ||
|
||
const isTopLevelVariableElement = const TypeMatcher<TopLevelVariableElement>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.