Documentation ¶
Index ¶
- func ClearImg(img draw.Image)
- func ClearImg2(img draw.Image, c color.Color)
- func CollectLog(t *testing.T, fn func() error) ([]byte, []byte, error)
- func CollectLog2(t *testing.T, logf func(string, ...any), fn func() error) ([]byte, []byte, error)
- func CompareImgs(img1, img2 image.Image) error
- func CompareImgsOrSavePng(img1 image.Image, filename2 string) error
- func DrawPoint(img draw.Image, p image.Point, size int, c color.Color)
- func GenerateImg(r image.Rectangle, seed int) image.Image
- func OpenImage(filename string) (image.Image, string, error)
- func RunArchive(t *testing.T, ar *Archive, filesExts []string, ...)
- func RunArchive2(t *testing.T, ar *Archive, ...)
- func SPrintImg(img image.Image) string
- func SPrintImgs(imgs ...image.Image) string
- func SourceCursor(cursorStr, src string, n int) (string, int, error)
- func TrimLineSpaces(str string) string
- func TrimLineSpaces2(str string, pre string) string
- type Archive
- type Script
- type ScriptCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectLog2 ¶ added in v1.3.7
func CompareImgs ¶
func RunArchive ¶
func RunArchive(t *testing.T, ar *Archive, filesExts []string, fn func(t2 *testing.T, name string, datas [][]byte) error, )
Expects n files named in filesExts args
func RunArchive2 ¶
func SPrintImgs ¶
func SourceCursor ¶
Allows a src string to have multiple cursor strings to simulate cursor position. Used in testing. Useful cursor runes: "●". First n position is zero.
func TrimLineSpaces ¶ added in v1.3.7
Useful to compare src code lines.
func TrimLineSpaces2 ¶ added in v1.3.7
Types ¶
type Archive ¶
type Archive struct { Tar *txtar.Archive Filename string // for errors Lines []int // Tar.Files[] line position in src }
func ParseTxtar ¶
type Script ¶
type Script struct { ScriptsDir string Args []string Cmds []*ScriptCmd // user cmds (provided) Work bool // don't remove work dir at end NoFilepathsFix bool // don't rewrite filepaths for current dir ScriptStart func(*testing.T) error // each script init ScriptStop func(*testing.T) error // each script close // contains filtered or unexported fields }
based on txtar (txt archive)
Click to show internal directories.
Click to hide internal directories.