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

Function TestMathWithExtension

ext/math_test.go:571–581  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

569}
570
571func TestMathWithExtension(t *testing.T) {
572 env := testMathEnv(t)
573 _, err := env.Extend(Math())
574 if err != nil {
575 t.Fatalf("env.Extend(Math()) failed: %v", err)
576 }
577 _, iss := env.Compile("math.least(0, 1, 2) == 0")
578 if iss.Err() != nil {
579 t.Errorf("env.Compile() failed: %v", iss.Err())
580 }
581}
582
583func TestMathVersions(t *testing.T) {
584 versionCases := []struct {

Callers

nothing calls this directly

Calls 5

testMathEnvFunction · 0.85
MathFunction · 0.85
ErrMethod · 0.80
CompileMethod · 0.65
ExtendMethod · 0.45

Tested by

no test coverage detected