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

Function TestPatch_Count

test/patch/patch_count_test.go:27–38  ·  view source on GitHub ↗

Test over a simple expression

(t *testing.T)

Source from the content-addressed store, hash-verified

25
26// Test over a simple expression
27func TestPatch_Count(t *testing.T) {
28 patcher := countingPatcher{}
29
30 _, err := expr.Compile(
31 `5 + 5`,
32 expr.Env(mock.Env{}),
33 expr.Patch(&patcher),
34 )
35 require.NoError(t, err)
36
37 require.Equal(t, 2, patcher.PatchCount, "Patcher run an unexpected number of times during compile")
38}
39
40// Test with operator overloading
41func TestPatchOperator_Count(t *testing.T) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…