MCPcopy
hub / github.com/stretchr/testify / Lenf

Function Lenf

require/require.go:1210–1218  ·  view source on GitHub ↗

Lenf asserts that the specified object has specific length. Lenf also fails if the object has a type that len() not accept. require.Lenf(t, mySlice, 3, "error message %s", "formatted")

(t TestingT, object interface{}, length int, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

1208//
1209// require.Lenf(t, mySlice, 3, "error message %s", "formatted")
1210func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) {
1211 if h, ok := t.(tHelper); ok {
1212 h.Helper()
1213 }
1214 if assert.Lenf(t, object, length, msg, args...) {
1215 return
1216 }
1217 t.FailNow()
1218}
1219
1220// Less asserts that the first element is less than the second
1221//

Callers 1

LenfMethod · 0.70

Calls 3

LenfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected