Assert, is a testing library built on top of Generics
- Go: +1.18
With Go module support (Go 1.11+), simply add the following import
import "github.com/goodjobtech/assert"
Otherwise, to install assert, run the following command:
go get -u github.com/goodjobtech/assert
package test
import (
"github.com/goodjobtech/assert"
"testing"
)
func TestSomething(t *testing.T) {
assert.Equal(t, 1, 1)
assert.NotEqual(t, "abc", "def")
assert.Nil(t, nil)
assert.NotNil(t, "")
assert.Contains(t, []int{1, 2, 3}, 1)
assert.NotContains(t, []int{1, 2, 3}, 4)
assert.True(t, true)
assert.False(t, false)
}
All kinds of pull request and feature requests are welcomed!
Asserts's source code is licensed under MIT License.