* chore: go get -u ./... * chore: go mod tidy * chore: go mod vendor * chore: fix compilation for buildkit >= 0.15.0 * chore: upgrade to Go 1.24 * chore: upgrade the Debian container used in an integration test |
||
|---|---|---|
| .. | ||
| mquery | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| because.go | ||
| comparer.go | ||
| exit.go | ||
| exit_freebsd.go | ||
| log.go | ||
| mint.go | ||
| mocks.go | ||
| result.go | ||
| testee.go | ||
README.md
mint
The very minimum assertion for Go.
package your_test
import (
"testing"
"pkg/your"
. "github.com/otiai10/mint"
)
func TestFoo(t *testing.T) {
foo := your.Foo()
Expect(t, foo).ToBe(1234)
Expect(t, foo).TypeOf("int")
Expect(t, foo).Not().ToBe(nil)
Expect(t, func() { yourFunc() }).Exit(1)
// If assertion failed, exit 1 with message.
Expect(t, foo).ToBe("foobarbuz")
// You can run assertions without os.Exit
res := Expect(t, foo).Dry().ToBe("bar")
// res.OK() == false
// You can omit repeated `t`.
m := mint.Blend(t)
m.Expect(foo).ToBe(1234)
}
features
- Simple syntax
- Loosely coupled
- Plain implementation
tests
go test ./...
use cases
Projects bellow use mint
