test library
Classes
- PackageContextForTest
-
Creates a temporary directory with a pubspec using the
test_descriptor
package, 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
suggestor
to generate a stream of patches forcontext
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
andsourceText
using thetest_descriptor
package, sets up analysis for that file, and returns a FileContext wrapper around it.