Fix tests

This commit is contained in:
Lunny Xiao 2021-06-30 11:22:45 +08:00
parent c00908cb1d
commit ac3ca38638
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 11 additions and 12 deletions

View File

@ -406,16 +406,16 @@ func TestFindMapPtrString(t *testing.T) {
assert.NoError(t, err)
}
func TestFindBit(t *testing.T) {
type FindBitStruct struct {
func TestFindBool(t *testing.T) {
type FindBoolStruct struct {
Id int64
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, PrepareEngine())
assertSync(t, new(FindBitStruct))
assertSync(t, new(FindBoolStruct))
cnt, err := testEngine.Insert([]FindBitStruct{
cnt, err := testEngine.Insert([]FindBoolStruct{
{
Msg: false,
},
@ -426,14 +426,13 @@ func TestFindBit(t *testing.T) {
assert.NoError(t, err)
assert.EqualValues(t, 2, cnt)
var results = make([]FindBitStruct, 0, 2)
var results = make([]FindBoolStruct, 0, 2)
err = testEngine.Find(&results)
assert.NoError(t, err)
assert.EqualValues(t, 2, len(results))
}
func TestFindMark(t *testing.T) {
type Mark struct {
Mark1 string `xorm:"VARCHAR(1)"`
Mark2 string `xorm:"VARCHAR(1)"`
@ -468,7 +467,7 @@ func TestFindAndCountOneFunc(t *testing.T) {
type FindAndCountStruct struct {
Id int64
Content string
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, PrepareEngine())

View File

@ -52,7 +52,7 @@ func TestQueryString2(t *testing.T) {
type GetVar3 struct {
Id int64 `xorm:"autoincr pk"`
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, testEngine.Sync2(new(GetVar3)))
@ -192,7 +192,7 @@ func TestQueryStringNoParam(t *testing.T) {
type GetVar4 struct {
Id int64 `xorm:"autoincr pk"`
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, testEngine.Sync2(new(GetVar4)))
@ -229,7 +229,7 @@ func TestQuerySliceStringNoParam(t *testing.T) {
type GetVar6 struct {
Id int64 `xorm:"autoincr pk"`
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, testEngine.Sync2(new(GetVar6)))
@ -266,7 +266,7 @@ func TestQueryInterfaceNoParam(t *testing.T) {
type GetVar5 struct {
Id int64 `xorm:"autoincr pk"`
Msg bool `xorm:"bit"`
Msg bool
}
assert.NoError(t, testEngine.Sync2(new(GetVar5)))