Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0. assert.Empty(t, obj)
(t TestingT, object interface{}, msgAndArgs ...interface{})
| 746 | // |
| 747 | // assert.Empty(t, obj) |
| 748 | func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { |
| 749 | pass := isEmpty(object) |
| 750 | if !pass { |
| 751 | if h, ok := t.(tHelper); ok { |
| 752 | h.Helper() |
| 753 | } |
| 754 | Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) |
| 755 | } |
| 756 | |
| 757 | return pass |
| 758 | |
| 759 | } |
| 760 | |
| 761 | // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either |
| 762 | // a slice or a channel with len == 0. |
searching dependent graphs…