mirror of https://github.com/stretchr/testify.git
Merge pull request #14 from jcelliott/master
Fix typo in doc.go and Fix panic in (Not)?Nil()pull/21/merge
commit
4e4760bad4
|
@ -173,8 +173,12 @@ func NotNil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool {
|
|||
|
||||
if object == nil {
|
||||
success = false
|
||||
} else if reflect.ValueOf(object).IsNil() {
|
||||
success = false
|
||||
} else {
|
||||
value := reflect.ValueOf(object)
|
||||
kind := value.Kind()
|
||||
if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
|
||||
success = false
|
||||
}
|
||||
}
|
||||
|
||||
if !success {
|
||||
|
@ -201,8 +205,12 @@ func Nil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool {
|
|||
|
||||
if object == nil {
|
||||
return true
|
||||
} else if reflect.ValueOf(object).IsNil() {
|
||||
return true
|
||||
} else {
|
||||
value := reflect.ValueOf(object)
|
||||
kind := value.Kind()
|
||||
if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if len(message) > 0 {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
//
|
||||
// assert.Error(t, errorObject [, message [, format-args]])
|
||||
//
|
||||
// assert.NotError(t, errorObject [, message [, format-args]])
|
||||
// assert.NoError(t, errorObject [, message [, format-args]])
|
||||
//
|
||||
// assert.Implements(t, (*MyInterface)(nil), new(MyObject) [,message [, format-args]])
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue