Documentation
¶
Index ¶
- func CursorPos(t *testing.T, e *view.Editor) int
- func EditorWithText(t *testing.T, text string) *view.Editor
- func GitCommitFile(t *testing.T, repo, name, content string) string
- func GitRepo(t *testing.T) string
- func RegisteredValue(t *testing.T, e *view.Editor, reg rune) string
- func RequireGit(t *testing.T)
- func RunGit(t *testing.T, dir string, args ...string)
- func SetCursor(t *testing.T, e *view.Editor, pos int)
- func SetEditorText(t *testing.T, e *view.Editor, text string)
- func SetSelection(t *testing.T, e *view.Editor, ranges []core.Range, primary int)
- func StatusMsg(e *view.Editor) string
- func WriteFile(t *testing.T, path, content string)
- type FakeClipboard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditorWithText ¶
EditorWithText creates an editor seeded with text and the cursor at pos 0
func GitCommitFile ¶
GitCommitFile writes and commits a file, returning its absolute path
func RegisteredValue ¶
RegisteredValue returns the first value stored in the named register
func RequireGit ¶
RequireGit skips the test when no git binary is on PATH
func SetEditorText ¶
SetEditorText inserts text into an existing editor's focused document
func SetSelection ¶
SetSelection replaces the focused view's selection
Types ¶
type FakeClipboard ¶
FakeClipboard is an in-memory view.Clipboard for hermetic tests, keeping the system and PRIMARY selections in separate buffers
func NewFakeClipboard ¶
func NewFakeClipboard() *FakeClipboard
NewFakeClipboard returns an in-memory clipboard for tests
func (*FakeClipboard) Available ¶
func (c *FakeClipboard) Available() bool
Available always reports true
func (*FakeClipboard) Read ¶
func (c *FakeClipboard) Read() (string, error)
Read returns the stored clipboard contents
func (*FakeClipboard) ReadPrimary ¶
func (c *FakeClipboard) ReadPrimary() (string, error)
ReadPrimary returns the stored primary selection
func (*FakeClipboard) Write ¶
func (c *FakeClipboard) Write(text string) error
Write stores text as the clipboard contents
func (*FakeClipboard) WritePrimary ¶
func (c *FakeClipboard) WritePrimary(text string) error
WritePrimary stores text as the primary selection