Fix unit tests.
This commit is contained in:
parent
9b826fff6e
commit
eccc17dc8a
10 changed files with 91 additions and 72 deletions
|
|
@ -6,13 +6,13 @@ import (
|
|||
)
|
||||
|
||||
func TestDeleteUnconditionally(t *testing.T) {
|
||||
_, err := table1.Delete().String()
|
||||
_, _, err := table1.DELETE().Sql()
|
||||
assert.Assert(t, err != nil)
|
||||
}
|
||||
|
||||
func TestDeleteWithWhere(t *testing.T) {
|
||||
sql, err := table1.Delete().WHERE(table1Col1.EqL(1)).String()
|
||||
sql, _, err := table1.DELETE().WHERE(table1Col1.EqL(1)).Sql()
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Equal(t, sql, "DELETE FROM db.table1 WHERE table1.col1 = 1;")
|
||||
assert.Equal(t, sql, "DELETE FROM db.table1 WHERE table1.col1 = $1;")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue