MCPcopy Index your code
hub / github.com/Masterminds/squirrel / TestConcatExpr

Function TestConcatExpr

expr_test.go:10–20  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestConcatExpr(t *testing.T) {
11 b := ConcatExpr("COALESCE(name,", Expr("CONCAT(?,' ',?)", "f", "l"), ")")
12 sql, args, err := b.ToSql()
13 assert.NoError(t, err)
14
15 expectedSql := "COALESCE(name,CONCAT(?,' ',?))"
16 assert.Equal(t, expectedSql, sql)
17
18 expectedArgs := []interface{}{"f", "l"}
19 assert.Equal(t, expectedArgs, args)
20}
21
22func TestConcatExprBadType(t *testing.T) {
23 b := ConcatExpr("prefix", 123, "suffix")

Callers

nothing calls this directly

Calls 3

ConcatExprFunction · 0.85
ExprFunction · 0.85
ToSqlMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…