(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestFormatSQLInternal_ValidSQL(t *testing.T) { |
| 92 | data, err := formatSQLInternal("select id from users", 4, true, true) |
| 93 | if err != nil { |
| 94 | t.Fatalf("unexpected error: %v", err) |
| 95 | } |
| 96 | if _, ok := data["formatted_sql"]; !ok { |
| 97 | t.Error("expected formatted_sql key") |
| 98 | } |
| 99 | opts, ok := data["options"].(map[string]any) |
| 100 | if !ok { |
| 101 | t.Fatal("expected options to be map[string]any") |
| 102 | } |
| 103 | if opts["indent_size"] != 4 { |
| 104 | t.Errorf("expected indent_size=4, got %v", opts["indent_size"]) |
| 105 | } |
| 106 | if opts["uppercase_keywords"] != true { |
| 107 | t.Errorf("expected uppercase_keywords=true") |
| 108 | } |
| 109 | if opts["add_semicolon"] != true { |
| 110 | t.Errorf("expected add_semicolon=true") |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func TestFormatSQLInternal_InvalidSQL(t *testing.T) { |
| 115 | _, err := formatSQLInternal(")))((( @@@ !!!", 2, false, false) |
nothing calls this directly
no test coverage detected