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

Function TestFindFrame

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

Source from the content-addressed store, hash-verified

2644}
2645
2646func TestFindFrame(t *testing.T) {
2647 frame := mustNewExecutionFrame(t, EmptyActivation())
2648 defer frame.Close()
2649
2650 tests := []struct {
2651 name string
2652 act Activation
2653 }{
2654 {
2655 name: "nested wrapper",
2656 act: &testActivationWrapper{Activation: &testActivationWrapper{Activation: frame, name: "w1"}, name: "w2"},
2657 },
2658 {
2659 name: "parent hierarchy",
2660 act: &parentActivationWrapper{parent: frame},
2661 },
2662 }
2663 for _, tc := range tests {
2664 t.Run(tc.name, func(t *testing.T) {
2665 found := findFrame(tc.act)
2666 if found != frame {
2667 t.Errorf("findFrame() = %v, wanted %v", found, frame)
2668 }
2669 })
2670 }
2671}
2672
2673func TestObservableInterpretable(t *testing.T) {
2674 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