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

Function TestRenumberIDs

common/ast/expr_test.go:481–493  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

479}
480
481func TestRenumberIDs(t *testing.T) {
482 fac := ast.NewExprFactory()
483 e := fac.NewUnspecifiedExpr(10)
484 e.RenumberIDs(testIDGen(100))
485 if e.ID() != 101 {
486 t.Errorf("RenumberIDs() got %d, wanted 101", e.ID())
487 }
488 e = fac.NewLiteral(20, types.True)
489 e.RenumberIDs(testIDGen(200))
490 if e.ID() != 201 {
491 t.Errorf("RenumberIDs() got %d, wanted 201", e.ID())
492 }
493}
494
495func nilTestExpr(t testing.TB) ast.Expr {
496 t.Helper()

Callers

nothing calls this directly

Calls 6

NewUnspecifiedExprMethod · 0.95
NewLiteralMethod · 0.95
NewExprFactoryFunction · 0.92
testIDGenFunction · 0.85
RenumberIDsMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected