(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func 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 | |
| 22 | func TestConcatExprBadType(t *testing.T) { |
| 23 | b := ConcatExpr("prefix", 123, "suffix") |
nothing calls this directly
no test coverage detected
searching dependent graphs…