Documentation
¶
Overview ¶
package Miniassert is a small assert library.
Usage:
package hello import ( "testing" "errors" assert "github.com/pilu/miniassert" ) type Foo struct {} func Hello() string { return "Hello World" } func TestSomething(t *testing.T) { assert.Equal(t, "Hello World", Hello()) assert.True(t, true) assert.False(t, false) var err error assert.Nil(t, err) err = errors.New("foo") assert.NotNil(t, err) foo := &Foo{} assert.Type(t, "*hello.Foo", foo) }
Run `go test` as usual.
Index ¶
- func Equal(t *testing.T, expected, actual interface{})
- func False(t *testing.T, value interface{})
- func Nil(t *testing.T, value interface{})
- func NotEqual(t *testing.T, expected, actual interface{})
- func NotNil(t *testing.T, value interface{})
- func True(t *testing.T, value interface{})
- func Type(t *testing.T, expectedType string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.