Versions in this module Expand all Collapse all v0 v0.1.1 May 12, 2022 v0.1.0 May 12, 2022 Changes in this version + var InitialWorkspaceLoad = CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromInitialWorkspaceLoad), 1, false) + func Main(m *testing.M, hook func(*source.Options)) + func Run(t *testing.T, files string, f TestFunc) + func WithOptions(opts ...RunOption) configuredRunner + type DiagnosticExpectation struct + func DiagnosticAt(name string, line, col int) DiagnosticExpectation + func NoDiagnosticAt(name string, line, col int) DiagnosticExpectation + func NoDiagnosticWithMessage(name, msg string) DiagnosticExpectation + func (e DiagnosticExpectation) Check(s State) Verdict + func (e DiagnosticExpectation) Description() string + type EditorConfig fake.EditorConfig + type Env struct + Ctx context.Context + Editor *fake.Editor + Sandbox *fake.Sandbox + Server servertest.Connector + T testing.TB + func NewEnv(ctx context.Context, tb testing.TB, sandbox *fake.Sandbox, ...) *Env + func (e *Env) AcceptCompletion(path string, pos fake.Pos, item protocol.CompletionItem) + func (e *Env) AnyDiagnosticAtCurrentVersion(name string) Expectation + func (e *Env) ApplyCodeAction(action protocol.CodeAction) + func (e *Env) ApplyQuickFixes(path string, diagnostics []protocol.Diagnostic) + func (e *Env) Await(expectations ...Expectation) + func (e *Env) ChangeConfiguration(t *testing.T, config *fake.EditorConfig) + func (e *Env) ChangeEnv(overlay map[string]string) + func (e *Env) ChangeFilesOnDisk(events []fake.FileEvent) + func (e *Env) CheckForFileChanges() + func (e *Env) CloseBuffer(name string) + func (e *Env) CodeAction(path string, diagnostics []protocol.Diagnostic) []protocol.CodeAction + func (e *Env) CodeLens(path string) []protocol.CodeLens + func (e *Env) Completion(path string, pos fake.Pos) *protocol.CompletionList + func (e *Env) CreateBuffer(name string, content string) + func (e *Env) DiagnosticAtRegexp(name, re string) DiagnosticExpectation + func (e *Env) DiagnosticAtRegexpFromSource(name, re, source string) DiagnosticExpectation + func (e *Env) DiagnosticAtRegexpWithMessage(name, re, msg string) DiagnosticExpectation + func (e *Env) DiagnosticsFor(name string) *protocol.PublishDiagnosticsParams + func (e *Env) DocumentHighlight(name string, pos fake.Pos) []protocol.DocumentHighlight + func (e *Env) DocumentLink(name string) []protocol.DocumentLink + func (e *Env) DoneWithChange() Expectation + func (e *Env) DoneWithChangeWatchedFiles() Expectation + func (e *Env) DoneWithClose() Expectation + func (e *Env) DoneWithOpen() Expectation + func (e *Env) DoneWithSave() Expectation + func (e *Env) DumpGoSum(dir string) + func (e *Env) EditBuffer(name string, edits ...fake.Edit) + func (e *Env) ExecuteCodeLensCommand(path string, cmd command.Command) + func (e *Env) ExecuteCommand(params *protocol.ExecuteCommandParams, result interface{}) + func (e *Env) FormatBuffer(name string) + func (e *Env) GetQuickFixes(path string, diagnostics []protocol.Diagnostic) []protocol.CodeAction + func (e *Env) GoSumDiagnostic(name, module string) Expectation + func (e *Env) GoToDefinition(name string, pos fake.Pos) (string, fake.Pos) + func (e *Env) Hover(name string, pos fake.Pos) (*protocol.MarkupContent, fake.Pos) + func (e *Env) NoDiagnosticAtRegexp(name, re string) DiagnosticExpectation + func (e *Env) OpenFile(name string) + func (e *Env) OrganizeImports(name string) + func (e *Env) ReadWorkspaceFile(name string) string + func (e *Env) References(path string, pos fake.Pos) []protocol.Location + func (e *Env) RegexpRange(name, re string) (fake.Pos, fake.Pos) + func (e *Env) RegexpReplace(name, regexpStr, replace string) + func (e *Env) RegexpSearch(name, re string) fake.Pos + func (e *Env) RemoveWorkspaceFile(name string) + func (e *Env) Rename(path string, pos fake.Pos, newName string) + func (e *Env) RunGenerate(dir string) + func (e *Env) RunGoCommand(verb string, args ...string) + func (e *Env) RunGoCommandInDir(dir, verb string, args ...string) + func (e *Env) SaveBuffer(name string) + func (e *Env) SaveBufferWithoutActions(name string) + func (e *Env) SetBufferContent(name string, content string) + func (e *Env) Symbol(query string) []fake.SymbolInformation + func (e *Env) WorkspaceSymbol(sym string) []protocol.SymbolInformation + func (e *Env) WriteWorkspaceFile(name, content string) + func (e *Env) WriteWorkspaceFiles(files map[string]string) + type Expectation interface + Check func(State) Verdict + Description func() string + func EmptyDiagnostics(name string) Expectation + func EmptyOrNoDiagnostics(name string) Expectation + func NoDiagnostics(name string) Expectation + func NoOutstandingDiagnostics() Expectation + func StartedChange(i uint64) Expectation + type LogExpectation struct + func LogMatching(typ protocol.MessageType, re string, count int, atLeast bool) LogExpectation + func NoErrorLogs() LogExpectation + func NoLogMatching(typ protocol.MessageType, re string) LogExpectation + func (e LogExpectation) Check(s State) Verdict + func (e LogExpectation) Description() string + type Mode int + const Experimental + const Forwarded + const SeparateProcess + const Singleton + func DefaultModes() Mode + type RegistrationExpectation struct + func RegistrationMatching(re string) RegistrationExpectation + func (e RegistrationExpectation) Check(s State) Verdict + func (e RegistrationExpectation) Description() string + type RunMultiple []struct + func (r RunMultiple) Run(t *testing.T, files string, f TestFunc) + type RunOption interface + func DebugAddress(addr string) RunOption + func GOPROXY(goproxy string) RunOption + func InExistingDir(dir string) RunOption + func InGOPATH() RunOption + func LimitWorkspaceScope() RunOption + func Modes(modes Mode) RunOption + func NoDefaultTimeout() RunOption + func Options(hook func(*source.Options)) RunOption + func ProxyFiles(txt string) RunOption + func SendPID() RunOption + func SkipHooks(skip bool) RunOption + func SkipLogs() RunOption + func WorkspaceFolders(relFolders ...string) RunOption + type Runner struct + DefaultModes Mode + GoplsPath string + OptionsHook func(*source.Options) + PrintGoroutinesOnFailure bool + SkipCleanup bool + TempDir string + Timeout time.Duration + func (r *Runner) AddCloser(closer io.Closer) + func (r *Runner) Close() error + func (r *Runner) Run(t *testing.T, files string, test TestFunc, opts ...RunOption) + type SimpleExpectation struct + func CompletedWork(title string, count uint64, atLeast bool) SimpleExpectation + func NoOutstandingWork() SimpleExpectation + func NoShowMessage() SimpleExpectation + func OnceMet(precondition Expectation, mustMeets ...Expectation) *SimpleExpectation + func OutstandingWork(title, msg string) SimpleExpectation + func ReadDiagnostics(fileName string, into *protocol.PublishDiagnosticsParams) *SimpleExpectation + func ShowMessageRequest(title string) SimpleExpectation + func ShownMessage(containing string) SimpleExpectation + func StartedWork(title string, atLeast uint64) SimpleExpectation + func (e SimpleExpectation) Check(s State) Verdict + func (e SimpleExpectation) Description() string + type State struct + func (s State) String() string + type TestFunc func(t *testing.T, env *Env) + type UnregistrationExpectation struct + func UnregistrationMatching(re string) UnregistrationExpectation + func (e UnregistrationExpectation) Check(s State) Verdict + func (e UnregistrationExpectation) Description() string + type Verdict int + const Met + const Unmeetable + const Unmet + func (v Verdict) String() string