Documentation
¶
Overview ¶
Package testutil provides test helpers for msgvault tests.
Index ¶
- func AssertFileContent(t *testing.T, path string, expected string)
- func MustExist(t *testing.T, path string)
- func MustNoErr(t *testing.T, err error, msg string)
- func MustNotExist(t *testing.T, path string)
- func NewTestStore(t *testing.T) *store.Store
- func ReadFile(t *testing.T, path string) []byte
- func TempDir(t *testing.T) string
- func WriteFile(t *testing.T, dir, name string, content []byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileContent ¶
AssertFileContent reads the file at path and asserts its content matches expected.
func MustNoErr ¶
MustNoErr fails the test immediately if err is non-nil. Use this for setup operations where failure means the test cannot proceed.
func MustNotExist ¶
MustNotExist fails the test if the path exists or if there's an error other than "not exist" (e.g., permission denied).
func NewTestStore ¶
NewTestStore creates a temporary database for testing. The database is automatically cleaned up when the test completes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.