Documentation ¶
Overview ¶
Package testos provides utilities for common OS assert/require test operations.
Index ¶
- func AssertExists(t *testing.T, osa osaPkg.I, path string) bool
- func AssertExistsIsDir(t *testing.T, osa osaPkg.I, path string, wantDir bool) bool
- func AssertFileData(t *testing.T, osa osaPkg.I, path string, want string) bool
- func AssertIsEmpty(t *testing.T, osa osaPkg.I, path string) bool
- func AssertNotExists(t *testing.T, osa osaPkg.I, path string) bool
- func AssertStdWrite(t *testing.T, stdWrite io.Writer, stdRead io.Reader, message string) bool
- func Join(elem ...string) string
- func RequireEmptyWrite(t *testing.T, osa osaPkg.I, path string)
- func RequireExists(t *testing.T, osa osaPkg.I, path string)
- func RequireExistsIsDir(t *testing.T, osa osaPkg.I, path string, wantDir bool)
- func RequireFileData(t *testing.T, osa osaPkg.I, path string, want string)
- func RequireIsEmpty(t *testing.T, osa osaPkg.I, path string)
- func RequireMkdir(t *testing.T, osa osaPkg.I, path string)
- func RequireMkdirAll(t *testing.T, osa osaPkg.I, path string)
- func RequireNotExists(t *testing.T, osa osaPkg.I, path string)
- func RequireTempDir(t *testing.T, osa osaPkg.I) string
- func RequireWrite(t *testing.T, osa osaPkg.I, path string, data string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertExists ¶
AssertExists asserts that a file or directory exists.
func AssertExistsIsDir ¶
AssertExistsIsDir asserts that an entry exists and is either file or directory.
func AssertFileData ¶
AssertFileData requires that a file exists and has a certain data
func AssertIsEmpty ¶
AssertIsEmpty asserts that a file or directory is empty.
func AssertNotExists ¶
AssertNotExists asserts that a file or directory does not exist.
func AssertStdWrite ¶
AssertStdWrite tests a writable standard stream (i.e. Stdout or Stderr).
func RequireEmptyWrite ¶
RequireEmptyWrite requires that writing an empty file succeeds.
func RequireExists ¶
RequireExists requires that a file or directory exists.
func RequireExistsIsDir ¶
RequireExistsIsDir requires that an entry exists and is either file or directory.
func RequireFileData ¶
RequireFileData requires that a file exists and has a certain data
func RequireIsEmpty ¶
RequireIsEmpty requires that a file or directory is empty.
func RequireMkdir ¶
RequireMkdir requires that creating a directory succeeds.
func RequireMkdirAll ¶
RequireMkdirAll requires that creating a directory (and possible parent directories) succeeds.
func RequireNotExists ¶
RequireNotExists requires that a file or directory does not exist.
func RequireTempDir ¶ added in v0.1.1
RequireTempDir requires that a temp dir was created.
Types ¶
This section is empty.