Len asserts that the specified object has specific length. Len also fails if the object has a type that len() not accept. assert.Len(t, mySlice, 3)
(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
| 1151 | // |
| 1152 | // assert.Len(t, mySlice, 3) |
| 1153 | func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { |
| 1154 | if h, ok := t.(tHelper); ok { |
| 1155 | h.Helper() |
| 1156 | } |
| 1157 | if assert.Len(t, object, length, msgAndArgs...) { |
| 1158 | return |
| 1159 | } |
| 1160 | t.FailNow() |
| 1161 | } |
| 1162 | |
| 1163 | // Lenf asserts that the specified object has specific length. |
| 1164 | // Lenf also fails if the object has a type that len() not accept. |