(t *testing.T)
| 530 | } |
| 531 | |
| 532 | func TestExtractFunctions_WindowFunction(t *testing.T) { |
| 533 | sql := "SELECT name, salary, ROW_NUMBER() OVER (ORDER BY salary DESC) as rank FROM employees" |
| 534 | astNode, err := Parse(sql) |
| 535 | if err != nil { |
| 536 | t.Fatalf("Failed to parse SQL: %v", err) |
| 537 | } |
| 538 | |
| 539 | functions := ExtractFunctions(astNode) |
| 540 | if !contains(functions, "ROW_NUMBER") { |
| 541 | t.Errorf("Expected 'ROW_NUMBER' window function, got: %v", functions) |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | func TestExtractFunctions_Update(t *testing.T) { |
| 546 | sql := "UPDATE users SET updated_at = NOW(), name = UPPER(name) WHERE id = 1" |
nothing calls this directly
no test coverage detected