Documentation
¶
Index ¶
- Constants
- func AssertIterResult[T any](t *testing.T, want []TestResult[T], got iter.Seq2[T, error])
- func CollectFiles(t *testing.T, fsys fs.FS) (ret map[string]FileInfo)
- func GZCompress(t *testing.T, data []byte) []byte
- func IterVal2Iter[T, U any](s []IterVal[T, U]) iter.Seq2[T, U]
- func MarshalJSON(t *testing.T, v any) []byte
- func PrepareTestDirectory(t *testing.T, fsys fs.FS) string
- func Ptr[T any](v T) *T
- func Slice2Seq2[T any](s []T) iter.Seq2[T, error]
- func TestDB(t *testing.T) *sqlx.DB
- func TestDBDSN(t *testing.T, dsn string) *sqlx.DB
- func TestPersistentDB(t *testing.T) *sqlx.DB
- func ToIter[T any](v []TestResult[T]) iter.Seq2[T, error]
- type FileInfo
- type IterVal
- type TestResult
Constants ¶
View Source
const Driver = "sqlite"
Variables ¶
This section is empty.
Functions ¶
func AssertIterResult ¶
AssertIterResult checks if the iterator returns the expected values.
func CollectFiles ¶
CollectFiles returns a map of file paths to file info.
func GZCompress ¶
GZCompress compresses data using gzip and returns the compressed data.
func MarshalJSON ¶
MarshalJSON marshals data to JSON and returns the byte slice.
func PrepareTestDirectory ¶
PrepareTestDirectory prepares a temporary directory for testing and populates it with files from fsys. It returns the path to the directory.
Types ¶
type TestResult ¶
TestResult is a pair of value and error to use in the test iterators.
func SliceToTestResult ¶
func SliceToTestResult[E any, T []E](t T) []TestResult[E]
SliceToTestResult converts a slice of values to a slice of TestResult.
func ToTestResult ¶
func ToTestResult[T any](v T, err error) TestResult[T]
Click to show internal directories.
Click to hide internal directories.