Documentation ¶
Index ¶
- Variables
- func CaptureStdout(f func(w io.Writer)) string
- func GetMaxStringMaxWidth(s string) int
- func MapRangeToRange(fromMin, fromMax, toMin, toMax, current float32) int
- func Percentage(total, current float64) float64
- func PercentageRound(total, current float64) float64
- func RemoveAndCountPrefix(input, subString string) (string, int)
- func TestDoesOutput(t *testing.T, logic func(w io.Writer))
- func TestPrintContains(t *testing.T, logic func(w io.Writer, a interface{}))
- func TestPrintfContains(t *testing.T, logic func(w io.Writer, format string, a interface{}))
- func TestPrintlnContains(t *testing.T, logic func(w io.Writer, a interface{}))
- func TestSprintContains(t *testing.T, logic func(a interface{}) string)
- func TestSprintfContains(t *testing.T, logic func(format string, a interface{}) string)
- func TestSprintlnContains(t *testing.T, logic func(a interface{}) string)
- func WithBoolean(b []bool) bool
Constants ¶
This section is empty.
Variables ¶
var RandomStrings = []string{
"hello world", "²³14234!`§=)$-.€@_&", "This is a sentence.", "This\nstring\nhas\nmultiple\nlines",
"windows\r\nline\r\nendings", "\rtext",
}
RandomStrings contains a list of random strings to use while testing.
Functions ¶
func CaptureStdout ¶ added in v0.7.0
CaptureStdout captures everything written to the terminal and returns it as a string.
func GetMaxStringMaxWidth ¶ added in v0.8.0
GetMaxStringMaxWidth returns the maximum width of a string with multiple lines.
func MapRangeToRange ¶ added in v0.5.1
func PercentageRound ¶
PercentageRound returns a rounded Percentage.
func RemoveAndCountPrefix ¶ added in v0.8.0
func TestDoesOutput ¶ added in v0.8.0
TestDoesOutput can be used to test if something is outputted to stdout.
func TestPrintContains ¶ added in v0.7.0
TestPrintContains can be used to test Print methods.
func TestPrintfContains ¶ added in v0.7.0
TestPrintfContains can be used to test Printf methods.
func TestPrintlnContains ¶ added in v0.7.0
TestPrintlnContains can be used to test Println methods.
func TestSprintContains ¶ added in v0.7.0
TestSprintContains can be used to test Sprint methods.
func TestSprintfContains ¶ added in v0.7.0
TestSprintfContains can be used to test Sprintf methods.
func TestSprintlnContains ¶ added in v0.7.0
TestSprintlnContains can be used to test Sprintln methods.
func WithBoolean ¶ added in v0.3.0
WithBoolean helps an option setter (WithXXX(b ...bool) to return true, if no boolean is set, but false if it's explicitly set to false.
Types ¶
This section is empty.