Improved error messages
This commit is contained in:
parent
2b28627e58
commit
7ab2ff6627
7 changed files with 46 additions and 43 deletions
20
Nil_test.go
20
Nil_test.go
|
@ -1,4 +1,3 @@
|
|||
|
||||
package assert_test
|
||||
|
||||
import (
|
||||
|
@ -8,18 +7,31 @@ import (
|
|||
)
|
||||
|
||||
func TestNil(t *testing.T) {
|
||||
var nilPointer *T
|
||||
var nilSlice []byte
|
||||
var (
|
||||
nilPointer *T
|
||||
nilInterface any
|
||||
nilSlice []byte
|
||||
nilMap map[byte]byte
|
||||
nilChannel chan byte
|
||||
nilFunction func()
|
||||
)
|
||||
|
||||
assert.Nil(t, nil)
|
||||
assert.Nil(t, nilPointer)
|
||||
assert.Nil(t, nilInterface)
|
||||
assert.Nil(t, nilSlice)
|
||||
assert.Nil(t, nilMap)
|
||||
assert.Nil(t, nilChannel)
|
||||
assert.Nil(t, nilFunction)
|
||||
}
|
||||
|
||||
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{})
|
||||
assert.NotNil(t, make([]byte, 0))
|
||||
assert.NotNil(t, make(map[byte]byte))
|
||||
assert.NotNil(t, make(chan byte))
|
||||
assert.NotNil(t, TestNotNil)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue