test library
Classes
- PackageContextForTest
-
Creates a temporary directory with a pubspec using the
test_descriptorpackage, installs dependencies withdart pub get, and sets up an analysis context for the package.
Functions
-
applyPatches(
SourceFile sourceFile, Iterable< Patch> patches) → String -
Returns the result of applying all of the
patches(insertions/deletions/replacements) to the contents ofsourceFile. -
expectSuggestorGeneratesPatches(
Suggestor suggestor, FileContext context, dynamic resultMatcher) → void -
Uses
suggestorto generate a stream of patches forcontextand returns what the resulting file contents would be after applying all of them. -
fileContextForTest(
String name, String sourceText) → Future< FileContext> -
Creates a temporary file with the given
nameandsourceTextusing thetest_descriptorpackage, sets up analysis for that file, and returns a FileContext wrapper around it.