Documentation
¶
Overview ¶
Package tst contains no runtime code, only universal helper for tests
Package lib contains helper functions for trice tool ¶
Package tst contains no runtime code, only universal helper for tests
Index ¶
- func Assert(tb testing.TB, condition bool, msg string, v ...interface{})
- func Assign(fn string) string
- func CleanFile(fileName string)
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func EqualFile(t *testing.T, fn, s string)
- func EqualFileContent(fn0, fn1 string) bool
- func EqualFiles(t *testing.T, fn0, fn1 string)
- func EqualFiles2(t *testing.T, fn0, fn1 string)
- func Equals(tb testing.TB, exp, act interface{})
- func Ok(tb testing.TB, err error)
- func ReadLines(file string) ([]string, error)
- func Timestamp() string
- func UniqLines(t *testing.T, inFile, outFile string) int
- func WriteLines(file string, lines []string) error
- type ArrayFlag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanFile ¶ added in v0.8.3
func CleanFile(fileName string)
CleanFile accepts a string representing a path and converts \r\n into \n (taken from https://github.com/cgati/dos2unix/blob/master/main.go)
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func EqualFile ¶ added in v0.8.3
EqualFile fails test if s is NOT equal to contence of fn Different lineendings are ignored
func EqualFileContent ¶ added in v0.8.3
EqualFileContent returns true if contece is equal
func EqualFiles ¶ added in v0.8.3
EqualFiles fails test if contence is NOT equal
func EqualFiles2 ¶ added in v0.8.3
EqualFiles2 fails test if contence is NOT equal Different lineendings are ignored
func Timestamp ¶ added in v0.8.3
func Timestamp() string
Timestamp returns local time as string according var TimeStampFormat https://www.alexedwards.net/blog/an-overview-of-go-tooling#managing-dependencies
func UniqLines ¶
UniqLines reads inFile, removes duplicate lines and writes to outFile inFile and outFile can be the same it returns count of remaining lines plus 1 (io.EOF ?)
func WriteLines ¶
WriteLines writes string slice containing lines to file