Otiai10 Mint Save

The very minimum assertion for Golang testing framework.

Project README

mint

Go codecov Go Report Card GoDoc GitHub tag (latest SemVer) FOSSA Status

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

License

FOSSA Status

Open Source Agenda is not affiliated with "Otiai10 Mint" Project. README Source: otiai10/mint
Stars
34
Open Issues
0
Last Commit
10 months ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating