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

Function TestNodeCount

common/ast/ast_test.go:396–404  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

394}
395
396func TestNodeCount(t *testing.T) {
397 if ast.NodeCount(nil) != 0 {
398 t.Errorf("NodeCount(nil) got %d, wanted 0", ast.NodeCount(nil))
399 }
400 checked := mustTypeCheck(t, `1 + 2`)
401 if count := ast.NodeCount(checked); count != 3 {
402 t.Errorf("NodeCount(1 + 2) got %d, wanted 3", count)
403 }
404}
405
406func TestHeights(t *testing.T) {
407 tests := []struct {

Callers

nothing calls this directly

Calls 2

NodeCountFunction · 0.92
mustTypeCheckFunction · 0.85

Tested by

no test coverage detected