Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enable ¶
func Enable(enabler func() []Option)
Enable registers colorized options for pretty-printing the output of assertions.
The argument passed is a function that is executed after package initialization and CLI arg parsing.
This is not intended for concurrent use as it sets a package-level state.
Types ¶
type Option ¶
type Option func(o *options)
Option is a colorization option.
func WithSanitizedTheme ¶
WithSanitizedTheme sets a colorization theme from its name or does nothing if the theme is not supported.
type StringColorizer ¶
StringColorizer wraps a string with ANSI escape codes.
This is a simpler alternative to difflib.PrinterBuilder for cases where streaming to a bufio.Writer is not needed.
func ActualColorizer ¶
func ActualColorizer() StringColorizer
ActualColorizer returns a colorizer for actual values.
It returns a no-op colorizer if colorization is not enabled.
func ExpectedColorizer ¶
func ExpectedColorizer() StringColorizer
ExpectedColorizer returns a colorizer for expected values.
It returns a no-op colorizer if colorization is not enabled.