MCPcopy Create free account
hub / github.com/expr-lang/expr / TestInterfaceMethod

Function TestInterfaceMethod

test/interface/interface_method_test.go:35–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestInterfaceMethod(t *testing.T) {
36 require.True(t, BarImpl{}.Aba())
37 require.True(t, BarImpl{}.Bar() == 42)
38
39 env := map[string]any{
40 "var": FooImpl{},
41 }
42 p, err := expr.Compile(`var.Foo().Bar()`, expr.Env(env))
43 assert.NoError(t, err)
44
45 out, err := expr.Run(p, env)
46 assert.NoError(t, err)
47 assert.Equal(t, 42, out)
48}

Callers

nothing calls this directly

Calls 8

TrueFunction · 0.92
CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92
AbaMethod · 0.80
BarMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…