Fix unit tests.

This commit is contained in:
zer0sub 2019-05-01 17:25:10 +02:00
parent 9b826fff6e
commit eccc17dc8a
10 changed files with 91 additions and 72 deletions

View file

@ -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;")
}