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

Function TestV2Adapter

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

Source from the content-addressed store, hash-verified

2557}
2558
2559func TestV2Adapter(t *testing.T) {
2560 legacy := &testLegacyInterpretable{id: 42}
2561 adapted := adaptToV2(legacy)
2562 if adapted.ID() != 42 {
2563 t.Errorf("adapted.ID() = %d, wanted 42", adapted.ID())
2564 }
2565 frame := mustNewExecutionFrame(t, EmptyActivation())
2566 defer frame.Close()
2567 val := adapted.Exec(frame)
2568 if val.Equal(types.IntOne) != types.True {
2569 t.Errorf("adapted.Exec() = %v, wanted 1", val)
2570 }
2571}
2572
2573func TestInterpretableArgs(t *testing.T) {
2574 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