MCPcopy
hub / github.com/expr-lang/expr / Len

Function Len

internal/testify/require/require.go:1153–1161  ·  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. assert.Len(t, mySlice, 3)

(t TestingT, object interface{}, length int, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1151//
1152// assert.Len(t, mySlice, 3)
1153func 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.

Callers 5

Benchmark_filterFunction · 0.92
Benchmark_filterMapFunction · 0.92
TestIssue823Function · 0.92
TestDebuggerFunction · 0.92
LenMethod · 0.70

Calls 3

LenFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by 4

Benchmark_filterFunction · 0.74
Benchmark_filterMapFunction · 0.74
TestIssue823Function · 0.74
TestDebuggerFunction · 0.74