add test for SQL get

This commit is contained in:
Lunny Xiao 2019-05-17 19:42:48 +08:00
parent f4184c5524
commit 678d6b93f9
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ func TestGetVar(t *testing.T) {
assert.Equal(t, 28, age) assert.Equal(t, 28, age)
var ageMax int var ageMax int
has, err = testEngine.SQL("SELECT max(age) FROM `get_var`").Get(&ageMax) has, err = testEngine.SQL("SELECT max(age) FROM `get_var` WHERE id = ?", data.Id).Get(&ageMax)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, true, has) assert.Equal(t, true, has)
assert.Equal(t, 28, ageMax) assert.Equal(t, 28, ageMax)