Documentation
¶
Index ¶
- Constants
- func Ah(line string) string
- func DurationLog(start time.Time, name string)
- func Equal(t *testing.T, actual, expected any)
- func Ko(line string) string
- func NoError(t *testing.T, err error)
- func NotEqual(t *testing.T, actual, expected any)
- func NotNil(t *testing.T, data any)
- func Ok(line string) string
- type DiffReporter
Examples ¶
Constants ¶
View Source
const ( OK = "✅" // no comments needed KO = "❌" // not OK OH = "😯" // WARNING AH = "🤨" // DEBUG or TODO )
Variables ¶
This section is empty.
Functions ¶
func Ah ¶
Ah helper function for terminal output decoration in yellow with 😯 Debugging and exploartion purpose.
Example ¶
fmt.Printf("%s", Ah("foo"))
Output: �[34;3m 🤨 foo �[0m
func DurationLog ¶
DurationLog measure the duration of a function
Usage:
defer helpers.DurationLog(time.Now())
func Equal ¶
Equal fails the test if not equal.
Example ¶
t := &testing.T{}
Equal(t, []string{"foo", "bar", "ln"}, []string{"foo", "bar", "lan"})
fmt.Printf("%v", t.Failed())
Output: true
func NoError ¶
NoError fails the test on error.
Example ¶
t := &testing.T{}
NoError(t, errors.New("unexpected error"))
fmt.Printf("%v", t.Failed())
Output: true
func NotEqual ¶
NotEqual fails the test if equal.
Example ¶
t := &testing.T{}
NotEqual(t, 2, 2)
fmt.Printf("%v", t.Failed())
Output: true
Types ¶
type DiffReporter ¶
type DiffReporter struct {
// contains filtered or unexported fields
}
DiffReporter is a simple custom reporter that only records differences detected during comparison.
func (*DiffReporter) PopStep ¶
func (r *DiffReporter) PopStep()
func (*DiffReporter) PushStep ¶
func (r *DiffReporter) PushStep(ps cmp.PathStep)
func (*DiffReporter) Report ¶
func (r *DiffReporter) Report(rs cmp.Result)
func (*DiffReporter) String ¶
func (r *DiffReporter) String() string
Click to show internal directories.
Click to hide internal directories.