MySQL update statement tests.

This commit is contained in:
go-jet 2019-08-02 11:08:24 +02:00
parent a46e8c1c51
commit 7660bdd8b5
12 changed files with 406 additions and 115 deletions

View file

@ -26,7 +26,7 @@ WHERE link.name = 'Bing';
`
testutils.AssertDebugStatementSql(t, query, expectedSQL, "Bong", "http://bong.com", "Bing")
assertExec(t, query, 1)
AssertExec(t, query, 1)
links := []model.Link{}
@ -71,7 +71,7 @@ WHERE link.name = 'Bing';
testutils.AssertDebugStatementSql(t, query, expectedSQL, "Bong", "Bing", "Bing")
assertExec(t, query, 1)
AssertExec(t, query, 1)
}
func TestUpdateAndReturning(t *testing.T) {
@ -129,7 +129,7 @@ WHERE link.id = 0;
`
testutils.AssertDebugStatementSql(t, stmt, expectedSQL, int64(0), int64(0))
assertExec(t, stmt, 1)
AssertExec(t, stmt, 1)
}
func TestUpdateWithInvalidSelect(t *testing.T) {
@ -178,7 +178,7 @@ WHERE link.id = 201;
`
testutils.AssertDebugStatementSql(t, stmt, expectedSQL, int32(201), "http://www.duckduckgo.com", "DuckDuckGo", nil, int64(201))
assertExec(t, stmt, 1)
AssertExec(t, stmt, 1)
}
func TestUpdateWithModelDataAndPredefinedColumnList(t *testing.T) {
@ -205,7 +205,7 @@ WHERE link.id = 201;
`
testutils.AssertDebugStatementSql(t, stmt, expectedSQL, nil, "DuckDuckGo", "http://www.duckduckgo.com", int64(201))
assertExec(t, stmt, 1)
AssertExec(t, stmt, 1)
}
func TestUpdateWithInvalidModelData(t *testing.T) {