Added basic assert functions

This commit is contained in:
Eduard Urbach 2023-07-05 15:46:19 +02:00
parent b73c6e6f90
commit 2b28627e58
Signed by: eduard
GPG key ID: 49226B848C78F6C8
6 changed files with 224 additions and 0 deletions

25
Nil_test.go Normal file
View 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{})
}