Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 73a7003

Browse files
lunnyBetaCat0
authored andcommitted
Add tests for get var (#1305)
* add test for SQL get * fix tests
1 parent a691000 commit 73a7003

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

session_get_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ func TestGetVar(t *testing.T) {
4747
assert.Equal(t, true, has)
4848
assert.Equal(t, 28, age)
4949

50+
var ageMax int
51+
has, err = testEngine.SQL("SELECT max(age) FROM "+testEngine.TableName("get_var", true)+" WHERE `id` = ?", data.Id).Get(&ageMax)
52+
assert.NoError(t, err)
53+
assert.Equal(t, true, has)
54+
assert.Equal(t, 28, ageMax)
55+
5056
var age2 int64
5157
has, err = testEngine.Table("get_var").Cols("age").
5258
Where("age > ?", 20).

0 commit comments

Comments
 (0)