Skip to content

Repository files navigation

tt

Simple and colorful test tools

CircleCI StatusAppveyorcodecovBuild StatusGo Report CardGoDocReleaseJoin the chat at https://gitter.im/go-ego/ego

Installation/Update

go get -u github.com/vcaesar/tt

Usage:

package tt
import (
"fmt""testing""github.com/vcaesar/tt""github.com/vcaesar/tt/example"
)
funcTestAdd(t*testing.T) {
fmt.Println(add.Add(1, 1))
tt.Expect(t, "1", add.Add(1, 1))
tt.Expect(t, "2", add.Add(1, 1))
tt.Equal(t, 1, add.Add(1, 1))
tt.Equal(t, 2, add.Add(1, 1))
at:=tt.New(t)
at.Expect("2", add.Add(1, 1))
at.Equal(2, add.Add(1, 1))
}
funcBenchmark1(b*testing.B) {
at:=tt.New(b)
fn:=func() {
at.Equal(2, add.Add(1, 1))
}
tt.BM(b, fn)
// at.BM(b, fn)
}
funcBenchmark2(b*testing.B) {
at:=tt.New(b)
fori:=0; i<b.N; i++ {
at.Equal(2, Add(1, 1))
}
}

Thanks

Testify, the code has some inspiration.

About

Simple and colorful test tools

Topics

Resources

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages