(t *testing.T)
| 400 | } |
| 401 | |
| 402 | func TestExtractColumns_Update(t *testing.T) { |
| 403 | sql := "UPDATE users SET active = false, updated_at = NOW() WHERE id = 1" |
| 404 | astNode, err := Parse(sql) |
| 405 | if err != nil { |
| 406 | t.Fatalf("Failed to parse SQL: %v", err) |
| 407 | } |
| 408 | |
| 409 | columns := ExtractColumns(astNode) |
| 410 | expected := []string{"active", "updated_at", "id"} |
| 411 | if !stringSlicesEqual(columns, expected) { |
| 412 | t.Errorf("Expected columns %v, got %v", expected, columns) |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | func TestExtractColumns_Insert(t *testing.T) { |
| 417 | sql := "INSERT INTO users (name, email) VALUES ('John', 'john@example.com')" |
nothing calls this directly
no test coverage detected