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

Function TestInterfaceHide

test/interface/interface_test.go:28–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestInterfaceHide(t *testing.T) {
29 var env Env
30 p, err := expr.Compile(`store.Get("foo")`, expr.Env(env))
31 assert.NoError(t, err)
32
33 out, err := expr.Run(p, Env{Store: StoreImpt{}})
34 assert.NoError(t, err)
35 assert.Equal(t, 42, out)
36
37 _, err = expr.Compile(`store.Set("foo", 100)`, expr.Env(env))
38 assert.Error(t, err)
39 assert.Contains(t, err.Error(), "type interface_test.StoreInterface has no method Set")
40}

Callers

nothing calls this directly

Calls 8

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 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…