MCPcopy Index your code
hub / github.com/expr-lang/expr / TestDeref_struct_func_args

Function TestDeref_struct_func_args

test/deref/deref_test.go:275–289  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

273}
274
275func TestDeref_struct_func_args(t *testing.T) {
276 n, _ := time.Parse(time.RFC3339, "2024-05-12T18:30:00+00:00")
277 duration := 30 * time.Minute
278 env := map[string]any{
279 "time": n,
280 "duration": &duration,
281 }
282
283 program, err := expr.Compile(`time.Add(duration).Format('2006-01-02T15:04:05Z07:00')`, expr.Env(env))
284 require.NoError(t, err)
285
286 out, err := expr.Run(program, env)
287 require.NoError(t, err)
288 require.Equal(t, "2024-05-12T19:00:00Z", out)
289}
290
291func TestDeref_ignore_func_args(t *testing.T) {
292 f := foo(1)

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92
ParseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…