(t *testing.T)
| 658 | } |
| 659 | |
| 660 | func TestHandleFormatSQL_UppercaseKeywords(t *testing.T) { |
| 661 | ctx := context.Background() |
| 662 | req := makeReq(map[string]any{ |
| 663 | "sql": "select id from users where active = true", |
| 664 | "uppercase_keywords": true, |
| 665 | }) |
| 666 | res, err := handleFormatSQL(ctx, req) |
| 667 | if err != nil { |
| 668 | t.Fatalf("unexpected error: %v", err) |
| 669 | } |
| 670 | data := unmarshalResult(t, res) |
| 671 | formatted, ok := data["formatted_sql"].(string) |
| 672 | if !ok || formatted == "" { |
| 673 | t.Fatal("expected non-empty formatted_sql") |
| 674 | } |
| 675 | opts, ok := data["options"].(map[string]any) |
| 676 | if !ok { |
| 677 | t.Fatal("expected 'options' map in result") |
| 678 | } |
| 679 | if opts["uppercase_keywords"] != true { |
| 680 | t.Errorf("expected uppercase_keywords=true in options, got %v", opts["uppercase_keywords"]) |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | func TestHandleFormatSQL_InvalidSQL(t *testing.T) { |
| 685 | ctx := context.Background() |
nothing calls this directly
no test coverage detected