Add test for insert nil struct field

This commit is contained in:
Lunny Xiao 2020-09-08 16:32:37 +08:00
parent 981b83bb67
commit c2e9d7a21f
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 6 additions and 0 deletions

View File

@ -1390,4 +1390,10 @@ func TestNilFromDB(t *testing.T) {
}) })
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, 1, cnt) assert.EqualValues(t, 1, cnt)
cnt, err = testEngine.Insert(&TestTable1{
UpdateTime: time.Now(),
})
assert.NoError(t, err)
assert.EqualValues(t, 1, cnt)
} }