fix test counts
This commit is contained in:
parent
cbe32ce225
commit
e0f2abf520
|
@ -247,7 +247,7 @@ type CountWithTableName struct {
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CountWithTableName) TableName() string {
|
func (CountWithTableName) TableName() string {
|
||||||
return "count_with_table_name1"
|
return "count_with_table_name1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ func TestWithTableName(t *testing.T) {
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
_, err = testEngine.Insert(&CountWithTableName{
|
_, err = testEngine.Insert(CountWithTableName{
|
||||||
Name: "limit",
|
Name: "limit",
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
@ -269,4 +269,8 @@ func TestWithTableName(t *testing.T) {
|
||||||
total, err := testEngine.OrderBy("id desc").Count(new(CountWithTableName))
|
total, err := testEngine.OrderBy("id desc").Count(new(CountWithTableName))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.EqualValues(t, 2, total)
|
assert.EqualValues(t, 2, total)
|
||||||
|
|
||||||
|
total, err = testEngine.OrderBy("id desc").Count(CountWithTableName{})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.EqualValues(t, 2, total)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue