Documentation
¶
Overview ¶
Package contenttest is the conformance suite of the provided documents of the extension contract (Documents().ProvideContent, OpenDiff, OpenDocument, Tabs, CloseTabs, Dirty and SaveAll, and ProvideMultiDiff and OpenMultiDiff of the multi-file diff editor): the host runs it over a window tab, and the fake of the tests of the extensions runs it too, so that an extension that passes its tests against the fake meets the same rules in the window.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Harness ¶
type Harness struct {
// API is the API of the extension under test, in an activation that is on.
API extension.API
// Text asks the window for the text of a provided document, as it does when it opens one, from any goroutine; the error has the
// tag ExtContentUnknown when no provider has the scheme.
Text func(ctx context.Context, uri string) (string, error)
// Label and Language ask the window for the name and the language of a provided document ("" for none).
Label, Language func(uri string) string
// Diffs, Docs and Changed are what the window was asked to open and what the provider said changed, since the start.
Diffs func() []extension.DiffSpec
Docs func() []extension.OpenSpec
Changed func() [][]string
// Deactivate ends the activation, as closing the window tab does.
Deactivate func()
// Failed tells whether the implementation took the extension off because of a panic in the provider.
Failed func() bool
// Pump lets the work posted to the UI thread run.
Pump func()
// MultiFiles asks the window for the files of a set of the multi-file diff editor, as it does when it opens the set, from any
// goroutine; the error has the tag ExtMultiDiffKindUnknown when no provider has the kind. MultiOpened and MultiChanged are the
// editors the window was asked to open and what the provider said changed, since the start.
MultiFiles func(ctx context.Context, kind, key string) ([]extension.MultiDiffResource, error)
MultiOpened func() []extension.MultiDiffSpec
MultiChanged func() [][]string
}
Harness is what an implementation gives the suite.