Files
Gogs/internal/dbx/string_test.go
ᴊᴏᴇ ᴄʜᴇɴ 36d56d5525 all: rename packages ending with "util" to end with "x" (#8182)
Co-authored-by: JSS <jss@unknwon.dev>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:25:19 -05:00

22 lines
395 B
Go

package dbx
import (
"testing"
"github.com/stretchr/testify/assert"
"gogs.io/gogs/internal/conf"
)
func TestQuote(t *testing.T) {
conf.UsePostgreSQL = true
got := Quote("SELECT * FROM %s", "user")
want := `SELECT * FROM "user"`
assert.Equal(t, want, got)
conf.UsePostgreSQL = false
got = Quote("SELECT * FROM %s", "user")
want = `SELECT * FROM user`
assert.Equal(t, want, got)
}