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

Function TestBuiltin_flatten_recursion_slice

builtin/builtin_test.go:792–806  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

790}
791
792func TestBuiltin_flatten_recursion_slice(t *testing.T) {
793 s := make([]any, 1)
794 s[0] = s
795
796 env := map[string]any{
797 "arr": s,
798 }
799
800 program, err := expr.Compile("flatten(arr)", expr.Env(env))
801 require.NoError(t, err)
802
803 _, err = expr.Run(program, env)
804 require.Error(t, err)
805 assert.Contains(t, err.Error(), builtin.ErrorMaxDepth.Error())
806}
807
808func TestBuiltin_numerical_recursion(t *testing.T) {
809 s := make([]any, 1)

Callers

nothing calls this directly

Calls 7

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
ErrorFunction · 0.92
ContainsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…