mirror of
https://github.com/gogs/gogs.git
synced 2026-02-18 12:27:01 +01:00
Co-authored-by: JSS <jss@unknwon.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
395 B
Go
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)
|
|
}
|