fix test counts

This commit is contained in:
Lunny Xiao 2019-01-20 17:47:44 +08:00
parent cbe32ce225
commit e0f2abf520
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 6 additions and 2 deletions

View File

@ -247,7 +247,7 @@ type CountWithTableName struct {
Name string
}
func (c *CountWithTableName) TableName() string {
func (CountWithTableName) TableName() string {
return "count_with_table_name1"
}
@ -261,7 +261,7 @@ func TestWithTableName(t *testing.T) {
})
assert.NoError(t, err)
_, err = testEngine.Insert(&CountWithTableName{
_, err = testEngine.Insert(CountWithTableName{
Name: "limit",
})
assert.NoError(t, err)
@ -269,4 +269,8 @@ func TestWithTableName(t *testing.T) {
total, err := testEngine.OrderBy("id desc").Count(new(CountWithTableName))
assert.NoError(t, err)
assert.EqualValues(t, 2, total)
total, err = testEngine.OrderBy("id desc").Count(CountWithTableName{})
assert.NoError(t, err)
assert.EqualValues(t, 2, total)
}