testutil

package
v0.0.0-...-8107675 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRecording

func IsRecording() bool

IsRecording returns true if the -record flag is set

Types

type TestData

type TestData struct {
	// contains filtered or unexported fields
}

TestData stores all the data of a test suite.

func LoadTestSuiteData

func LoadTestSuiteData(dir, suiteName string) (res TestData, err error)

LoadTestSuiteData loads test suite data from file.

func (*TestData) GenerateOutputIfNeeded

func (t *TestData) GenerateOutputIfNeeded() error

GenerateOutputIfNeeded generate the output file.

func (*TestData) GetTestCases

func (t *TestData) GetTestCases(c *check.C, in interface{}, out interface{})

GetTestCases gets the test cases for a test function.

func (*TestData) GetTestCasesWithoutOut

func (t *TestData) GetTestCasesWithoutOut(c *check.C, in interface{})

GetTestCasesWithoutOut gets the test cases for a test function without separate output. This is used for tests where the test data includes both inputs and expected outputs in the same structure (e.g., when there is no separate output file).

func (*TestData) OnRecord

func (t *TestData) OnRecord(updateFunc func())

OnRecord execute the function to update result.

Jump to

Keyboard shortcuts

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