mirror of https://github.com/stretchr/testify.git
Test Nil assertion behavior for typed nil values
parent
fb64a0ab08
commit
ee60e76e54
|
@ -211,6 +211,9 @@ func TestNil(t *testing.T) {
|
||||||
if !Nil(mockT, nil) {
|
if !Nil(mockT, nil) {
|
||||||
t.Error("Nil should return true: object is nil")
|
t.Error("Nil should return true: object is nil")
|
||||||
}
|
}
|
||||||
|
if !Nil(mockT, (*struct{})(nil)) {
|
||||||
|
t.Error("Nil should return true: object is (*struct{})(nil)")
|
||||||
|
}
|
||||||
if Nil(mockT, new(AssertionTesterConformingObject)) {
|
if Nil(mockT, new(AssertionTesterConformingObject)) {
|
||||||
t.Error("Nil should return false: object is not nil")
|
t.Error("Nil should return false: object is not nil")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue