MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestParseContext_EmptyTokens

Function TestParseContext_EmptyTokens

pkg/sql/parser/context_test.go:424–442  ·  view source on GitHub ↗

TestParseContext_EmptyTokens verifies handling of empty token list

(t *testing.T)

Source from the content-addressed store, hash-verified

422
423// TestParseContext_EmptyTokens verifies handling of empty token list
424func 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}

Callers

nothing calls this directly

Calls 4

ReleaseMethod · 0.95
ParseContextMethod · 0.95
NewParserFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected