(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestCaseWithNoWhenClause(t *testing.T) { |
| 131 | caseStmt := Case("something"). |
| 132 | Else("42") |
| 133 | |
| 134 | qb := Select().Column(caseStmt).From("table") |
| 135 | |
| 136 | _, _, err := qb.ToSql() |
| 137 | |
| 138 | assert.Error(t, err) |
| 139 | |
| 140 | assert.Equal(t, "case expression must contain at lease one WHEN clause", err.Error()) |
| 141 | } |
| 142 | |
| 143 | func TestCaseBuilderMustSql(t *testing.T) { |
| 144 | defer func() { |