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

Function TestCaseWithNoWhenClause

case_test.go:130–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

128}
129
130func 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
143func TestCaseBuilderMustSql(t *testing.T) {
144 defer func() {

Callers

nothing calls this directly

Calls 6

CaseFunction · 0.85
SelectFunction · 0.85
ElseMethod · 0.80
ColumnMethod · 0.80
ToSqlMethod · 0.65
FromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…