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

Function TestV2Adapter

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

Source from the content-addressed store, hash-verified

2814}
2815
2816func TestV2Adapter(t *testing.T) {
2817 legacy := &testLegacyInterpretable{id: 42}
2818 adapted := adaptToV2(legacy)
2819 if adapted.ID() != 42 {
2820 t.Errorf("adapted.ID() = %d, wanted 42", adapted.ID())
2821 }
2822 frame := mustNewExecutionFrame(t, EmptyActivation())
2823 defer frame.Close()
2824 val := adapted.Exec(frame)
2825 if val.Equal(types.IntOne) != types.True {
2826 t.Errorf("adapted.Exec() = %v, wanted 1", val)
2827 }
2828}
2829
2830func TestInterpretableArgs(t *testing.T) {
2831 tests := []struct {

Callers

nothing calls this directly

Calls 7

adaptToV2Function · 0.85
mustNewExecutionFrameFunction · 0.85
EmptyActivationFunction · 0.85
CloseMethod · 0.80
IDMethod · 0.65
ExecMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected