lib

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(tb testing.TB, condition bool, msg string, v ...interface{})

Assert fails the test if the condition is false.

func Assign

func Assign(fn string) string

func CopyDir

func CopyDir(src string, dst string) (err error)

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

func CopyFile(src, dst string) (err error)

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 Equals

func Equals(tb testing.TB, exp, act interface{})

Equals fails the test if exp is not equal to act.

func Ok

func Ok(tb testing.TB, err error)

Ok fails the test if an err is not nil.

func ReadLines

func ReadLines(file string) ([]string, error)

WriteLines writes string slice containing lines to file

func UniqLines

func UniqLines(t *testing.T, inFile, outFile string) int

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

func WriteLines(file string, lines []string) error

WriteLines writes string slice containing lines to file

Types

type ArrayFlag

type ArrayFlag []string

ArrayFlag is a slice type for multi flag

var (
	Srcs ArrayFlag // gets multiple files or directories
)

func (*ArrayFlag) Set

func (i *ArrayFlag) Set(value string) error

func (*ArrayFlag) String

func (i *ArrayFlag) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL