Test utils reuse.
This commit is contained in:
parent
74288d5418
commit
d3d00910aa
16 changed files with 200 additions and 221 deletions
|
|
@ -17,7 +17,7 @@ WHERE table1.col_int >= $2;
|
|||
|
||||
fmt.Println(stmt.Sql())
|
||||
|
||||
assertStatement(t, stmt, expectedSQL, 1, int64(33))
|
||||
assertStatementSql(t, stmt, expectedSQL, 1, int64(33))
|
||||
}
|
||||
|
||||
func TestUpdateWithValues(t *testing.T) {
|
||||
|
|
@ -32,7 +32,7 @@ WHERE table1.col_int >= $3;
|
|||
|
||||
fmt.Println(stmt.Sql())
|
||||
|
||||
assertStatement(t, stmt, expectedSQL, 1, 22.2, int64(33))
|
||||
assertStatementSql(t, stmt, expectedSQL, 1, 22.2, int64(33))
|
||||
}
|
||||
|
||||
func TestUpdateOneColumnWithSelect(t *testing.T) {
|
||||
|
|
@ -53,10 +53,10 @@ RETURNING table1.col1 AS "table1.col1";
|
|||
WHERE(table1Col1.EQ(Int(2))).
|
||||
RETURNING(table1Col1)
|
||||
|
||||
assertStatement(t, stmt, expectedSQL, int64(2))
|
||||
assertStatementSql(t, stmt, expectedSQL, int64(2))
|
||||
}
|
||||
|
||||
func TestInvalidInputs(t *testing.T) {
|
||||
assertStatementErr(t, table1.UPDATE(table1ColInt).SET(1), "jet: WHERE clause not set")
|
||||
assertStatementErr(t, table1.UPDATE(nil).SET(1), "jet: nil column in columns list")
|
||||
assertStatementSqlErr(t, table1.UPDATE(table1ColInt).SET(1), "jet: WHERE clause not set")
|
||||
assertStatementSqlErr(t, table1.UPDATE(nil).SET(1), "jet: nil column in columns list")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue