add some get tests

This commit is contained in:
Lunny Xiao 2017-05-23 12:06:22 +08:00
parent 1ff7790a2e
commit 1743f266cb
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,15 @@ func TestGetVar(t *testing.T) {
assert.Equal(t, true, has)
assert.Equal(t, 28, age)
var age2 int64
has, err = testEngine.Table("get_var").Cols("age").
Where("age > ?", 20).
And("age < ?", 30).
Get(&age2)
assert.NoError(t, err)
assert.Equal(t, true, has)
assert.EqualValues(t, 28, age2)
var money float64
has, err = testEngine.Table("get_var").Cols("money").Get(&money)
assert.NoError(t, err)