test

package
v0.32.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContainsMatch added in v0.14.1

func AssertContainsMatch(t *testing.T, strs []string, pattern *regexp.Regexp, message string)

func CreateMockCommand added in v0.7.1

func CreateMockCommand(t *testing.T, swappers []*CommandSwapper) func(cmd string, args ...string) *exec.Cmd

CreateMockCommand creates a command function that will verify its receiving the right sequence of commands from lazygit

func GenerateRepo

func GenerateRepo(filename string) error

GenerateRepo generates a repo from test/repos and changes the directory to be inside the newly made repo

Types

type CommandSwapper added in v0.7.1

type CommandSwapper struct {
	Expect  string
	Replace string
}

CommandSwapper takes a command, verifies that it is what it's expected to be and then returns a replacement command that will actually be called by the os

func (*CommandSwapper) SwapCommand added in v0.7.1

func (i *CommandSwapper) SwapCommand(t *testing.T, cmd string, args []string) *exec.Cmd

SwapCommand verifies the command is what we expected, and swaps it out for a different command

type FakeFieldLogger added in v0.32.1

type FakeFieldLogger struct {
	*logrus.Entry
	// contains filtered or unexported fields
}

for now we're just tracking calls to the Error and Errorf methods

func (*FakeFieldLogger) AssertErrors added in v0.32.1

func (self *FakeFieldLogger) AssertErrors(t *testing.T, expectedErrors []string)

func (*FakeFieldLogger) Error added in v0.32.1

func (self *FakeFieldLogger) Error(args ...interface{})

func (*FakeFieldLogger) Errorf added in v0.32.1

func (self *FakeFieldLogger) Errorf(format string, args ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL