Documentation ¶
Index ¶
- Variables
- func CaptureStdout(t *testing.T, fn func()) string
- func DoMapsMatch(t *testing.T, expectedMap map[string]interface{}, ...)
- func ExpectBool(t *testing.T, expectedBool bool, testBool bool)
- func ExpectError(t *testing.T, expectedError error, testError error)
- func ExpectErrorContainingText(t *testing.T, expectedSubtext string, testError error)
- func ExpectFileExists(io FileIo, t *testing.T, filePath string)
- func ExpectFileJson(io FileIo, t *testing.T, filePath string, data map[string]interface{})
- func ExpectFileJsonPart(io FileIo, t *testing.T, filePath string, subsetData map[string]interface{})
- func ExpectFileNotExists(io FileIo, t *testing.T, filePath string)
- func ExpectPanic(t *testing.T, fn func())
- func ExpectPanicError(t *testing.T, expectedError error, fn func())
- func ExpectString(t *testing.T, expectedStr string, testStr string)
- func ExpectValue(t *testing.T, expectedVal interface{}, testVal interface{})
- func NewTestEnvironment() *testEnvironment
- func NiceJs(testJson string) string
- func NiceYaml(testYaml string) string
- type FileIo
- type TestFile
- type TestFileHook
- type TestFileInfo
- type TestFileIo
- func (tfi *TestFileIo) Chtimes(name string, atime, mtime time.Time) error
- func (tfi *TestFileIo) CopyFile(src, dest string) (int64, error)
- func (tfi *TestFileIo) Dump()
- func (tfi *TestFileIo) FileExists(name string) (bool, error)
- func (tfi *TestFileIo) IsDirectory(name string) (bool, error)
- func (tfi *TestFileIo) IsEmptyDir(name string) bool
- func (tfi *TestFileIo) MkdirAll(name string, perm fs.FileMode) error
- func (tfi *TestFileIo) ReadDir(src string) (files []fs.DirEntry, err error)
- func (tfi *TestFileIo) ReadFile(filePath string) ([]byte, error)
- func (tfi *TestFileIo) RemoveAll(name string) error
- func (tfi *TestFileIo) Stat(name string) (os.FileInfo, error)
- func (tfi *TestFileIo) Walk(root string, fn filepath.WalkFunc) (err error)
- func (tfi *TestFileIo) WriteFile(filePath string, data []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Environ = processEnvironment(&realEnvironment{})
Functions ¶
func CaptureStdout ¶
func DoMapsMatch ¶
func ExpectFileExists ¶ added in v1.0.3
func ExpectFileJson ¶ added in v1.0.3
func ExpectFileJsonPart ¶ added in v1.0.3
func ExpectFileNotExists ¶ added in v1.0.7
func ExpectPanic ¶
func ExpectPanicError ¶
func ExpectValue ¶
func NewTestEnvironment ¶ added in v1.0.11
func NewTestEnvironment() *testEnvironment
Types ¶
type FileIo ¶ added in v1.0.3
type FileIo interface { ReadFile(filePath string) ([]byte, error) WriteFile(filePath string, data []byte, perm fs.FileMode) error Stat(name string) (os.FileInfo, error) MkdirAll(name string, perm fs.FileMode) error RemoveAll(name string) error IsDirectory(name string) (bool, error) CopyFile(src, dest string) (int64, error) ReadDir(src string) ([]fs.DirEntry, error) FileExists(name string) (bool, error) Walk(root string, fn filepath.WalkFunc) error Chtimes(name string, atime, mtime time.Time) error }
type TestFileHook ¶ added in v1.0.5
type TestFileInfo ¶ added in v1.0.3
type TestFileInfo struct {
// contains filtered or unexported fields
}
func (*TestFileInfo) IsDir ¶ added in v1.0.3
func (tfi *TestFileInfo) IsDir() bool
func (*TestFileInfo) ModTime ¶ added in v1.0.3
func (tfi *TestFileInfo) ModTime() time.Time
func (*TestFileInfo) Mode ¶ added in v1.0.3
func (tfi *TestFileInfo) Mode() os.FileMode
func (*TestFileInfo) Name ¶ added in v1.0.3
func (tfi *TestFileInfo) Name() string
func (*TestFileInfo) Size ¶ added in v1.0.3
func (tfi *TestFileInfo) Size() int64
func (*TestFileInfo) Sys ¶ added in v1.0.3
func (tfi *TestFileInfo) Sys() interface{}
type TestFileIo ¶ added in v1.0.3
type TestFileIo struct { ForceError map[string]error Hooks map[string]TestFileHook // contains filtered or unexported fields }
func NewTestFileIo ¶ added in v1.0.3
func NewTestFileIo() *TestFileIo
func (*TestFileIo) Chtimes ¶ added in v1.0.10
func (tfi *TestFileIo) Chtimes(name string, atime, mtime time.Time) error
func (*TestFileIo) CopyFile ¶ added in v1.0.3
func (tfi *TestFileIo) CopyFile(src, dest string) (int64, error)
func (*TestFileIo) Dump ¶ added in v1.0.3
func (tfi *TestFileIo) Dump()
func (*TestFileIo) FileExists ¶ added in v1.0.3
func (tfi *TestFileIo) FileExists(name string) (bool, error)
func (*TestFileIo) IsDirectory ¶ added in v1.0.3
func (tfi *TestFileIo) IsDirectory(name string) (bool, error)
func (*TestFileIo) IsEmptyDir ¶ added in v1.0.3
func (tfi *TestFileIo) IsEmptyDir(name string) bool
func (*TestFileIo) MkdirAll ¶ added in v1.0.3
func (tfi *TestFileIo) MkdirAll(name string, perm fs.FileMode) error
func (*TestFileIo) ReadDir ¶ added in v1.0.3
func (tfi *TestFileIo) ReadDir(src string) (files []fs.DirEntry, err error)
func (*TestFileIo) ReadFile ¶ added in v1.0.3
func (tfi *TestFileIo) ReadFile(filePath string) ([]byte, error)
func (*TestFileIo) RemoveAll ¶ added in v1.0.3
func (tfi *TestFileIo) RemoveAll(name string) error
func (*TestFileIo) Stat ¶ added in v1.0.3
func (tfi *TestFileIo) Stat(name string) (os.FileInfo, error)
Click to show internal directories.
Click to hide internal directories.