Files
Gogs/internal/dbutil/string_test.go
ᴊᴏᴇ ᴄʜᴇɴ 59e9fa191b chore: remove all MIT license file headers (#8083)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2026-01-08 19:32:15 -05:00

22 lines
398 B
Go

package dbutil
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)
}