File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,6 @@ import (
77 "github.com/cedar-policy/cedar-go/types"
88)
99
10- func countNodes (n Node ) int {
11- c := 0
12- Inspect (n , func (IsNode ) bool { c ++ ; return true })
13- return c
14- }
15-
1610func TestInspectCounts (t * testing.T ) {
1711 t .Parallel ()
1812 leaf1 := NodeValue {Value : types .Long (1 )}
@@ -62,7 +56,9 @@ func TestInspectCounts(t *testing.T) {
6256 tt := tt
6357 t .Run (tt .name , func (t * testing.T ) {
6458 t .Parallel ()
65- testutil .Equals (t , countNodes (tt .node ), tt .want )
59+ c := 0
60+ Inspect (tt .node , func (IsNode ) bool { c ++ ; return true })
61+ testutil .Equals (t , c , tt .want )
6662 })
6763 }
6864}
@@ -85,7 +81,6 @@ func TestInspectSkipChildren(t *testing.T) {
8581func TestInspectNil (t * testing.T ) {
8682 t .Parallel ()
8783 var count int
88- // Test that Inspect handles nil Node gracefully without panicking
8984 Inspect (Node {}, func (n IsNode ) bool {
9085 count ++
9186 return true
You can’t perform that action at this time.
0 commit comments