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

Function TestPatch

expr_test.go:1743–1754  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1741}
1742
1743func TestPatch(t *testing.T) {
1744 program, err := expr.Compile(
1745 `Foo == "Foo.String"`,
1746 expr.Env(mock.Env{}),
1747 expr.Patch(&mock.StringerPatcher{}),
1748 )
1749 require.NoError(t, err)
1750
1751 output, err := expr.Run(program, mock.Env{})
1752 require.NoError(t, err)
1753 require.Equal(t, true, output)
1754}
1755
1756func TestCompile_exposed_error(t *testing.T) {
1757 _, err := expr.Compile(`1 == true`)

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
PatchFunction · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…