tst

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package tst provides some helper functions for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqualFiles added in v0.27.8

func AssertEqualFiles(t *testing.T, fn0, fn1 string)

AssertEqualFiles fails test if content is NOT equal

func CaptureStdOut

func CaptureStdOut(f func()) string

CaptureStdOut captures stdout and returns it as string.

func EqualLines

func EqualLines(tb testing.TB, exp, act string)

EqualLines compares exp and act line by line ignoring line endings and leading/trailing spaces.

func EqualTextFiles

func EqualTextFiles(t *testing.T, fSys *afero.Afero, fn0, fn1 string)

EqualTextFiles fails test if lines in fn0 & fn1 NOT equal. Line endings are ignored

func TempFileName

func TempFileName(pattern string) (s string)

TempFileName returns a temporary file name based on pattern. The file is created and deleted and only the name is delivered. The pattern should contain at least an asterisks. Example: "myFile-*.bin"

Types

This section is empty.

Jump to

Keyboard shortcuts

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