Added basic assert functions
This commit is contained in:
parent
b73c6e6f90
commit
2b28627e58
6 changed files with 224 additions and 0 deletions
25
Nil_test.go
Normal file
25
Nil_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
package assert_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.akyoto.dev/go/assert"
|
||||
)
|
||||
|
||||
func TestNil(t *testing.T) {
|
||||
var nilPointer *T
|
||||
var nilSlice []byte
|
||||
|
||||
assert.Nil(t, nil)
|
||||
assert.Nil(t, nilPointer)
|
||||
assert.Nil(t, nilSlice)
|
||||
}
|
||||
|
||||
func TestNotNil(t *testing.T) {
|
||||
assert.NotNil(t, 0)
|
||||
assert.NotNil(t, "Hello")
|
||||
assert.NotNil(t, []byte{})
|
||||
assert.NotNil(t, T{})
|
||||
assert.NotNil(t, &T{})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue