TestParseContext_EmptyTokens verifies handling of empty token list
(t *testing.T)
| 422 | |
| 423 | // TestParseContext_EmptyTokens verifies handling of empty token list |
| 424 | func TestParseContext_EmptyTokens(t *testing.T) { |
| 425 | ctx := context.Background() |
| 426 | p := NewParser() |
| 427 | defer p.Release() |
| 428 | |
| 429 | // Empty token list |
| 430 | tokens := []token.Token{} |
| 431 | |
| 432 | ast, err := p.ParseContext(ctx, tokens) |
| 433 | |
| 434 | // Should get an error for no statements |
| 435 | if err == nil { |
| 436 | t.Error("Expected error for empty token list") |
| 437 | } |
| 438 | |
| 439 | if ast != nil { |
| 440 | t.Error("Expected nil AST for empty token list") |
| 441 | } |
| 442 | } |
nothing calls this directly
no test coverage detected