test library

Classes

PackageContextForTest
Creates a temporary directory with a pubspec using the test_descriptor package, installs dependencies with dart 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 of sourceFile.
expectSuggestorGeneratesPatches(Suggestor suggestor, FileContext context, dynamic resultMatcher) → void
Uses suggestor to generate a stream of patches for context and 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 name and sourceText using the test_descriptor package, sets up analysis for that file, and returns a FileContext wrapper around it.