MCPcopy
hub / github.com/Masterminds/squirrel / TestWherePartsAppendToSql

Function TestWherePartsAppendToSql

where_test.go:11–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestWherePartsAppendToSql(t *testing.T) {
12 parts := []Sqlizer{
13 newWherePart("x = ?", 1),
14 newWherePart(nil),
15 newWherePart(Eq{"y": 2}),
16 }
17 sql := &bytes.Buffer{}
18 args, _ := appendToSql(parts, sql, " AND ", []interface{}{})
19 assert.Equal(t, "x = ? AND y = ?", sql.String())
20 assert.Equal(t, []interface{}{1, 2}, args)
21}
22
23func TestWherePartsAppendToSqlErr(t *testing.T) {
24 parts := []Sqlizer{newWherePart(1)}

Callers

nothing calls this directly

Calls 2

newWherePartFunction · 0.85
appendToSqlFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…