(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestExceedsDepthNilSafety(t *testing.T) { |
| 261 | if ast.ExceedsDepth(nil, 250) { |
| 262 | t.Error("ExceedsDepth(nil, 250) = true, wanted false") |
| 263 | } |
| 264 | if ast.ExceedsDepth(ast.NewAST(nil, nil), 250) { |
| 265 | t.Error("ExceedsDepth(emptyAST, 250) = true, wanted false") |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | func TestExceedsDepthBoundedTraversal(t *testing.T) { |
| 270 | // Build a synthetic AST nested far deeper than the parser's recursion limit would ever produce. |
nothing calls this directly
no test coverage detected