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

Function Len

require/require.go:1196–1204  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

1194//
1195// require.Len(t, mySlice, 3)
1196func 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.

Callers 1

LenMethod · 0.70

Calls 3

LenFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected