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

Function TestFindFrame

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

Source from the content-addressed store, hash-verified

2901}
2902
2903func TestFindFrame(t *testing.T) {
2904 frame := mustNewExecutionFrame(t, EmptyActivation())
2905 defer frame.Close()
2906
2907 tests := []struct {
2908 name string
2909 act Activation
2910 }{
2911 {
2912 name: "nested wrapper",
2913 act: &testActivationWrapper{Activation: &testActivationWrapper{Activation: frame, name: "w1"}, name: "w2"},
2914 },
2915 {
2916 name: "parent hierarchy",
2917 act: &parentActivationWrapper{parent: frame},
2918 },
2919 }
2920 for _, tc := range tests {
2921 t.Run(tc.name, func(t *testing.T) {
2922 found := findFrame(tc.act)
2923 if found != frame {
2924 t.Errorf("findFrame() = %v, wanted %v", found, frame)
2925 }
2926 })
2927 }
2928}
2929
2930func TestObservableInterpretable(t *testing.T) {
2931 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