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

Function TestBuiltin_flatten_recursion

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

Source from the content-addressed store, hash-verified

774}
775
776func TestBuiltin_flatten_recursion(t *testing.T) {
777 var s []any
778 s = append(s, &s) // s contains a pointer to itself
779
780 env := map[string]any{
781 "arr": s,
782 }
783
784 program, err := expr.Compile("flatten(arr)", expr.Env(env))
785 require.NoError(t, err)
786
787 _, err = expr.Run(program, env)
788 require.Error(t, err)
789 assert.Contains(t, err.Error(), builtin.ErrorMaxDepth.Error())
790}
791
792func TestBuiltin_flatten_recursion_slice(t *testing.T) {
793 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…