testhelper

package
v0.0.0-...-4845449 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

nolint forbidigo

Index

Constants

View Source
const (
	DownArrow = "\u001B[B"
	Space     = " "
	Enter     = "\n"
)

Variables

This section is empty.

Functions

func AssertWildcards

func AssertWildcards(t assert.TestingT, expected string, actual string, msg string)

AssertWildcards compares two texts, in expected value can be used wildcards, see WildcardToRegexp function.

func EscapeWhitespaces

func EscapeWhitespaces(input string) string

EscapeWhitespaces escapes all whitespaces except new line -> for better difference in diff output.

func NewVirtualTerminal

func NewVirtualTerminal(t *testing.T, opts ...expect.ConsoleOpt) (*expect.Console, *vt10x.State, error)

func ReplaceEnvsString

func ReplaceEnvsString(str string, provider EnvProvider) string

ReplaceEnvsString replaces ENVs in given string.

func TestIsVerbose

func TestIsVerbose() bool

func VerboseStderr

func VerboseStderr() io.WriteCloser

func VerboseStdout

func VerboseStdout() io.WriteCloser

func WildcardToRegexp

func WildcardToRegexp(pattern string) string

WildcardToRegexp converts string with wildcards to regexp, so it can be used in assert.Regexp.

Types

type EnvProvider

type EnvProvider interface {
	MustGet(key string) string
}

Jump to

Keyboard shortcuts

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