AnalysisRuleTest class abstract
A base class for analysis rule tests that use test_reflective_loader.
Constructors
Properties
- addFixnumPackageDep → bool
-
Adds the 'fixnum' package as a dependency to the package-under-test.
no setterinherited
- addFlutterPackageDep → bool
-
Adds the 'flutter' package as a dependency to the package-under-test.
no setterinherited
- addJsPackageDep → bool
-
Adds the 'js' package as a dependency to the package-under-test.
no setterinherited
- addKernelPackageDep → bool
-
Adds the 'kernel' package as a dependency to the package-under-test.
no setterinherited
- addMetaPackageDep → bool
-
Adds the 'meta' package as a dependency to the package-under-test.
no setterinherited
- addTestReflectiveLoaderPackageDep → bool
-
Adds the 'test_reflective_loader' package as a dependency to the
package-under-test.
no setterinherited
- analysisRule → String
-
The name of the analysis rule which this test is concerned with.
no setter
- dumpAstOnFailures → bool
-
Whether to print out the syntax tree being tested, on a test failure.
no setterinherited
-
experiments
→ List<
String> -
The list of language experiments to be enabled for these tests.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
ignoredDiagnosticCodes
→ List<
DiagnosticCode> -
Error codes that by default should be ignored in test expectations.
no setterinherited
- packagesRootPath → String
-
The path to the root of the external packages.
no setterinherited
- pathContext → Context
-
The path context of resourceProvider.
no setterinherited
- resourceProvider → ResourceProvider
-
latefinalinherited
- result ↔ ResolvedUnitResult
-
The analysis result that is used in various
assertDiagnosticsmethods.getter/setter pairinherited - rule ↔ AbstractAnalysisRule
-
The
AbstractAnalysisRuleunder test.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- testFile ↔ File
-
The test file being analyzed.
getter/setter pairinherited
- testFileName → String
-
The name of the test file.
no setterinherited
- testPackageLanguageVersion → String?
-
The language version for the package-under-test.
no setterinherited
- testPackageLibPath → String
-
no setterinherited
- testPackagePubspecPath → String
-
no setterinherited
- testPackageRootPath → String
-
no setterinherited
- workspaceRootPath → String
-
no setterinherited
Methods
-
addAngularMeta(
) → Folder -
inherited
-
addFfi(
) → Folder -
inherited
-
addFixnum(
) → Folder -
inherited
-
addFlutter(
) → Folder -
inherited
-
addFlutterTest(
) → Folder -
inherited
-
addJs(
) → Folder -
inherited
-
addKernel(
) → Folder -
inherited
-
addMeta(
) → Folder -
inherited
-
addPedantic(
) → Folder -
inherited
-
addTestReflectiveLoader(
) → Folder -
inherited
-
addUI(
) → Folder -
inherited
-
addVectorMath(
) → Folder -
inherited
-
assertDiagnostics(
String content, List< ExpectedDiagnostic> expectedDiagnostics) → Future<void> -
Asserts that the number of diagnostics reported in
contentmatches the number ofexpectedDiagnosticsand that they have the expected error descriptions and locations.inherited -
assertDiagnosticsIn(
List< Diagnostic> diagnostics, List<ExpectedDiagnostic> expectedDiagnostics) → void -
Asserts that the diagnostics in
diagnosticsmatchexpectedDiagnostics.inherited -
assertDiagnosticsInFile(
String path, List< ExpectedDiagnostic> expectedDiagnostics) → Future<void> -
Asserts that the number of diagnostics that have been gathered at
pathmatches the number ofexpectedDiagnosticsand that they have the expected error descriptions and locations.inherited -
assertDiagnosticsInUnits(
List< (String, List< unitsAndDiagnostics) → Future<ExpectedDiagnostic> )>void> -
Asserts that the diagnostics for each
pathmatch those in the pairedexpectedDiagnostics.inherited -
assertNoDiagnostics(
String content) → Future< void> -
Asserts that there are no diagnostics in the given
content.inherited -
assertNoDiagnosticsInFile(
String path) → Future< void> -
Asserts that there are no diagnostics in the file at the given
path.inherited -
assertNoPubspecDiagnostics(
String content) → Future< void> -
Asserts that no diagnostics are reported when resolving
content. -
assertPubspecDiagnostics(
String content, List< ExpectedDiagnostic> expectedDiagnostics) → Future<void> -
Asserts that
expectedDiagnosticsare reported when resolvingcontent. -
convertPath(
String filePath) → String -
Converts the given posix
filePathto conform to resourceProvider's path context.inherited -
correctionMessage(
List< Diagnostic> diagnostics) → String - Text to display upon failure, which indicates possible corrections.
-
deleteFile(
String path) → void -
Deletes the file at
path.inherited -
deleteFolder(
String path) → void -
Deletes the folder at
path.inherited -
fromUri(
Uri uri) → String -
Returns
urias a String.inherited -
getFile(
String path) → File -
Gets the
Fileatpath.inherited -
getFolder(
String path) → Folder -
Gets the
Folderatpath.inherited -
join(
String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8]) → String -
Joins the part paths as per
path.Context.join.inherited -
lint(
int offset, int length, {Pattern? correctionContains, Pattern? messageContains, List< Pattern> messageContainsAll = const [], String? name, List<ExpectedContextMessage> ? contextMessages}) → ExpectedDiagnostic -
Returns an "expected diagnostic" for rule (or
name, if given) atoffsetandlength. -
missingExpectedMessage(
List< ExpectedDiagnostic> unmatchedExpected) → String -
Text to display upon failure, indicating that
unmatchedExpecteddiagnostics were expected, but not found.inherited -
modifyFile2(
File file, String content) → void -
Writes
contenttofile.inherited -
newAnalysisOptionsYamlFile(
String directoryPath, String content) → File -
Writes a new
analysis_options.yamlfile atdirectoryPathwithcontent.inherited -
newBazelBuildFile(
String directoryPath, String content) → File -
Creates a new Bazel BUILD file at
directoryPathwithcontent.inherited -
newBuildGnFile(
String directoryPath, String content) → File -
Creates a new BUILD.gn file at
directoryPathwithcontent.inherited -
newFile(
String path, String content) → File -
Writes
contentto the file atpath.inherited -
newFolder(
String path) → Folder -
Creates and returns a new
Folderatpath.inherited -
newLink(
String path, String target) → Link -
Creates and returns a new
Linkatpathtotarget.inherited -
newPackage(
String name) → PackageBuilder -
Registers a package named
name.inherited -
newPackageConfigJsonFile(
String directoryPath, String content) → File -
Writes a
.dart_tool/package_config.jsonfile atdirectoryPathwithcontent.inherited -
newPackageConfigJsonFileFromBuilder(
String directoryPath, PackageConfigFileBuilder builder) → File -
Writes a
.dart_tool/package_config.jsonfile atdirectoryPath.inherited -
newPubspecYamlFile(
String directoryPath, String content) → File -
Writes a
pubspec.yamlfile atdirectoryPathwithcontent.inherited -
newSinglePackageConfigJsonFile(
{required String packagePath, required String name}) → void -
Writes a new
.dart_tool/package_config.jsonfile for a package rooted atpackagePath, namedname.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveFile(
String path) → Future< ResolvedUnitResult> -
Resolves a Dart source file at
path.inherited -
setUp(
) → void -
tearDown(
) → Future< void> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toUri(
String path) → Uri -
Converts
pathto a URI.inherited -
toUriStr(
String path) → String -
Converts
pathto a URI and returns the normalized String representation of the URI.inherited -
unexpectedMessage(
List< Diagnostic> unmatchedActual) → String -
Text to display upon failure, indicating that
unmatchedActualdiagnostics were found, but unexpected. -
writePackageConfig(
String path, PackageConfigFileBuilder config) → void -
inherited
-
writeTestPackageConfig(
PackageConfigFileBuilder config) → void -
Writes a
package_config.jsonfile fromconfig, and for packages that have been added vianewPackage.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited