Added equality checks
This commit is contained in:
parent
a929de1b7c
commit
d365caf5a9
8 changed files with 122 additions and 12 deletions
29
Equal_test.go
Normal file
29
Equal_test.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package assert_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.akyoto.dev/go/assert"
|
||||
)
|
||||
|
||||
type T struct{ A int }
|
||||
|
||||
func TestEqual(t *testing.T) {
|
||||
assert.Equal(t, 0, 0)
|
||||
assert.Equal(t, "Hello", "Hello")
|
||||
assert.Equal(t, T{A: 10}, T{A: 10})
|
||||
}
|
||||
|
||||
func TestNotEqual(t *testing.T) {
|
||||
assert.NotEqual(t, 0, 1)
|
||||
assert.NotEqual(t, "Hello", "World")
|
||||
assert.NotEqual(t, &T{A: 10}, &T{A: 10})
|
||||
assert.NotEqual(t, T{A: 10}, T{A: 20})
|
||||
}
|
||||
|
||||
func TestDeepEqual(t *testing.T) {
|
||||
assert.DeepEqual(t, 0, 0)
|
||||
assert.DeepEqual(t, "Hello", "Hello")
|
||||
assert.DeepEqual(t, T{A: 10}, T{A: 10})
|
||||
assert.DeepEqual(t, &T{A: 10}, &T{A: 10})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue