MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestFindFrame

Function TestFindFrame

interpreter/interpreter_test.go:2833–2858  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2831}
2832
2833func TestFindFrame(t *testing.T) {
2834 frame := mustNewExecutionFrame(t, EmptyActivation())
2835 defer frame.Close()
2836
2837 tests := []struct {
2838 name string
2839 act Activation
2840 }{
2841 {
2842 name: "nested wrapper",
2843 act: &testActivationWrapper{Activation: &testActivationWrapper{Activation: frame, name: "w1"}, name: "w2"},
2844 },
2845 {
2846 name: "parent hierarchy",
2847 act: &parentActivationWrapper{parent: frame},
2848 },
2849 }
2850 for _, tc := range tests {
2851 t.Run(tc.name, func(t *testing.T) {
2852 found := findFrame(tc.act)
2853 if found != frame {
2854 t.Errorf("findFrame() = %v, wanted %v", found, frame)
2855 }
2856 })
2857 }
2858}
2859
2860func TestObservableInterpretable(t *testing.T) {
2861 obsInt := &ObservableInterpretable{InterpretableV2: NewConstValue(12, types.True)}

Callers

nothing calls this directly

Calls 4

mustNewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85
findFrameFunction · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected