AnalysisRuleTest class abstract

A base class for analysis rule tests that use test_reflective_loader.

Constructors

AnalysisRuleTest()

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 assertDiagnostics methods.
getter/setter pairinherited
rule ↔ AbstractAnalysisRule
The AbstractAnalysisRule under 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 content matches the number of expectedDiagnostics and that they have the expected error descriptions and locations.
inherited
assertDiagnosticsIn(List<Diagnostic> diagnostics, List<ExpectedDiagnostic> expectedDiagnostics) → void
Asserts that the diagnostics in diagnostics match expectedDiagnostics.
inherited
assertDiagnosticsInFile(String path, List<ExpectedDiagnostic> expectedDiagnostics) Future<void>
Asserts that the number of diagnostics that have been gathered at path matches the number of expectedDiagnostics and that they have the expected error descriptions and locations.
inherited
assertDiagnosticsInUnits(List<(String, List<ExpectedDiagnostic>)> unitsAndDiagnostics) Future<void>
Asserts that the diagnostics for each path match those in the paired expectedDiagnostics.
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 expectedDiagnostics are reported when resolving content.
convertPath(String filePath) String
Converts the given posix filePath to 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 uri as a String.
inherited
getFile(String path) → File
Gets the File at path.
inherited
getFolder(String path) → Folder
Gets the Folder at path.
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) at offset and length.
missingExpectedMessage(List<ExpectedDiagnostic> unmatchedExpected) String
Text to display upon failure, indicating that unmatchedExpected diagnostics were expected, but not found.
inherited
modifyFile2(File file, String content) → void
Writes content to file.
inherited
newAnalysisOptionsYamlFile(String directoryPath, String content) → File
Writes a new analysis_options.yaml file at directoryPath with content.
inherited
newBazelBuildFile(String directoryPath, String content) → File
Creates a new Bazel BUILD file at directoryPath with content.
inherited
newBuildGnFile(String directoryPath, String content) → File
Creates a new BUILD.gn file at directoryPath with content.
inherited
newFile(String path, String content) → File
Writes content to the file at path.
inherited
newFolder(String path) → Folder
Creates and returns a new Folder at path.
inherited
Creates and returns a new Link at path to target.
inherited
newPackage(String name) → PackageBuilder
Registers a package named name.
inherited
newPackageConfigJsonFile(String directoryPath, String content) → File
Writes a .dart_tool/package_config.json file at directoryPath with content.
inherited
newPackageConfigJsonFileFromBuilder(String directoryPath, PackageConfigFileBuilder builder) → File
Writes a .dart_tool/package_config.json file at directoryPath.
inherited
newPubspecYamlFile(String directoryPath, String content) → File
Writes a pubspec.yaml file at directoryPath with content.
inherited
newSinglePackageConfigJsonFile({required String packagePath, required String name}) → void
Writes a new .dart_tool/package_config.json file for a package rooted at packagePath, named name.
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 path to a URI.
inherited
toUriStr(String path) String
Converts path to a URI and returns the normalized String representation of the URI.
inherited
unexpectedMessage(List<Diagnostic> unmatchedActual) String
Text to display upon failure, indicating that unmatchedActual diagnostics were found, but unexpected.
writePackageConfig(String path, PackageConfigFileBuilder config) → void
inherited
writeTestPackageConfig(PackageConfigFileBuilder config) → void
Writes a package_config.json file from config, and for packages that have been added via newPackage.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited