NotEmpty asserts that the specified object is NOT [Empty]. if assert.NotEmpty(t, obj) { assert.Equal(t, "two", obj[1]) }
(t TestingT, object interface{}, msgAndArgs ...interface{})
| 805 | // assert.Equal(t, "two", obj[1]) |
| 806 | // } |
| 807 | func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { |
| 808 | pass := !isEmpty(object) |
| 809 | if !pass { |
| 810 | if h, ok := t.(tHelper); ok { |
| 811 | h.Helper() |
| 812 | } |
| 813 | Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) |
| 814 | } |
| 815 | |
| 816 | return pass |
| 817 | } |
| 818 | |
| 819 | // getLen tries to get the length of an object. |
| 820 | // It returns (0, false) if impossible. |