Len asserts that the specified object has specific length. Len also fails if the object has a type that len() not accept. require.Len(t, mySlice, 3)
(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
| 1194 | // |
| 1195 | // require.Len(t, mySlice, 3) |
| 1196 | func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { |
| 1197 | if h, ok := t.(tHelper); ok { |
| 1198 | h.Helper() |
| 1199 | } |
| 1200 | if assert.Len(t, object, length, msgAndArgs...) { |
| 1201 | return |
| 1202 | } |
| 1203 | t.FailNow() |
| 1204 | } |
| 1205 | |
| 1206 | // Lenf asserts that the specified object has specific length. |
| 1207 | // Lenf also fails if the object has a type that len() not accept. |