MCPcopy Create free account
hub / github.com/gogs/gogs / TestQuote

Function TestQuote

internal/dbutil/string_test.go:11–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestQuote(t *testing.T) {
12 conf.UsePostgreSQL = true
13 got := Quote("SELECT * FROM %s", "user")
14 want := `SELECT * FROM "user"`
15 assert.Equal(t, want, got)
16 conf.UsePostgreSQL = false
17
18 got = Quote("SELECT * FROM %s", "user")
19 want = `SELECT * FROM user`
20 assert.Equal(t, want, got)
21}

Callers

nothing calls this directly

Calls 1

QuoteFunction · 0.85

Tested by

no test coverage detected