Documentation ¶
Index ¶
- func AssertStdOutAndStdErr(t *testing.T, testdata *TestData, ttName string, ...)
- func RunTestCommand_Execute(t *testing.T, tests []TestCaseExecute, testdata *TestData, newCmd Factory, ...)
- func RunTestCommand_Parse(t *testing.T, tests []TestCaseParse, testdata *TestData, newCmd Factory, ...)
- func RunTestCommand_Usage(t *testing.T, tests []TestCaseUsage, testdata *TestData, newCmd Factory, ...)
- type CustomAssertion
- type Factory
- type SetupFunc
- type TestCaseExecute
- type TestCaseParse
- type TestCaseUsage
- type TestData
- func (d *TestData) CompareWithGolden(t *testing.T, update bool, goldenFileName string, actual []byte)
- func (d *TestData) FileName(t *testing.T, elm ...string) string
- func (d *TestData) ReadFile(t *testing.T, filename string) []byte
- func (d *TestData) RootDir(t *testing.T) string
- func (d *TestData) TempDirInTestdata(t *testing.T, suffix string) string
- func (d *TestData) WriteFile(t *testing.T, filename string, data []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertStdOutAndStdErr ¶
func RunTestCommand_Execute ¶
func RunTestCommand_Execute( t *testing.T, tests []TestCaseExecute, testdata *TestData, newCmd Factory, customAssertion CustomAssertion[TestCaseExecute], )
func RunTestCommand_Parse ¶
func RunTestCommand_Parse( t *testing.T, tests []TestCaseParse, testdata *TestData, newCmd Factory, customAssertion CustomAssertion[TestCaseParse], )
func RunTestCommand_Usage ¶
func RunTestCommand_Usage( t *testing.T, tests []TestCaseUsage, testdata *TestData, newCmd Factory, customAssertion CustomAssertion[TestCaseUsage], )
Types ¶
type CustomAssertion ¶
type TestCaseExecute ¶
type TestCaseExecute struct { Name string Args []string Want int Setup SetupFunc[TestCaseExecute] }
type TestCaseParse ¶
type TestCaseParse struct { Name string Args []string WantError bool Setup SetupFunc[TestCaseParse] }
type TestCaseUsage ¶
type TestCaseUsage struct { Name string Setup SetupFunc[TestCaseUsage] }
type TestData ¶
type TestData struct {
// contains filtered or unexported fields
}
func (*TestData) CompareWithGolden ¶
func (*TestData) TempDirInTestdata ¶
TempDirInTestdata makes temp directory for test. If you need fixed name temp directory, use this method instead of testing.T.TempDir().
Click to show internal directories.
Click to hide internal directories.