Documentation ¶
Overview ¶
Package testdriver is a support package for plugins written using github.com/govim/govim
Index ¶
- Constants
- Variables
- func Condition(cond string) (bool, error)
- func EnvSubst(ts *testscript.TestScript, neg bool, args []string)
- func ErrLogMatch(ts *testscript.TestScript, neg bool, args []string)
- func Sleep(ts *testscript.TestScript, neg bool, args []string)
- func Vim() (exitCode int)
- func VimExprWait() (exitCode int)
- type Config
- type Debug
- type LockingBuffer
- type TestDriver
- type VimConfig
Constants ¶
const (
KeyErrLog = "errLog"
)
Variables ¶
var (
DefaultErrLogMatchWait string
)
Functions ¶
func Condition ¶
Condition reports whether the given condition cond is satisfied or not. This function is called after the builtin testscript conditions which are documented in the testscript package, examples include:
[short] [go1.14]
Example conditions:
golang.org/issues/1234 Satisfied if GOVIM_TESTSCRIPT_ISSUES does not contain a regexp that matches the condition string
github.com/govim/govim/issues/4321 Satisfied if GOVIM_TESTSCRIPT_ISSUES does not contain a regexp that matches the condition string
[vim] Satisfied if we are testing with vim
[gvim] Satisfied if we are testing with gvim
[v1.2.3] Satisfied if we are running vim/gvim/whatever version >=v1.2.3
func EnvSubst ¶ added in v0.0.32
func EnvSubst(ts *testscript.TestScript, neg bool, args []string)
EnvSubst expands environment variable references in a file with the value of the current testscript environment.
func ErrLogMatch ¶
func ErrLogMatch(ts *testscript.TestScript, neg bool, args []string)
func Sleep ¶
func Sleep(ts *testscript.TestScript, neg bool, args []string)
Sleep is a convenience function for those odd occasions when you need to drop in a sleep, e.g. waiting for CursorHold to trigger
func Vim ¶
func Vim() (exitCode int)
Vim is a sidecar that effectively drives Vim via a simple JSON-based API
func VimExprWait ¶ added in v0.0.27
func VimExprWait() (exitCode int)
Types ¶
type LockingBuffer ¶
type LockingBuffer struct { NextSearchInx int // contains filtered or unexported fields }
func (*LockingBuffer) Bytes ¶
func (l *LockingBuffer) Bytes() []byte
type TestDriver ¶
type TestDriver struct {
// contains filtered or unexported fields
}
func NewTestDriver ¶
func NewTestDriver(c *Config) (*TestDriver, error)
func (*TestDriver) Close ¶
func (d *TestDriver) Close()
func (*TestDriver) LogStripANSI ¶
func (d *TestDriver) LogStripANSI(r io.Reader)
func (*TestDriver) Logf ¶
func (d *TestDriver) Logf(format string, a ...interface{})
func (*TestDriver) Run ¶
func (d *TestDriver) Run() error
func (*TestDriver) Wait ¶
func (d *TestDriver) Wait() error