improve uint tests (#1990)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1990
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Lunny Xiao 2021-07-14 17:06:53 +08:00
parent b296c8f1d7
commit 69a7db5312
1 changed files with 10 additions and 0 deletions

View File

@ -173,6 +173,16 @@ func TestUintId(t *testing.T) {
err = testEngine.CreateTables(&UintId{}) err = testEngine.CreateTables(&UintId{})
assert.NoError(t, err) assert.NoError(t, err)
tables, err := testEngine.DBMetas()
assert.NoError(t, err)
assert.EqualValues(t, 1, len(tables))
cols := tables[0].PKColumns()
assert.EqualValues(t, 1, len(cols))
if testEngine.Dialect().URI().DBType == schemas.MYSQL {
assert.EqualValues(t, "UNSIGNED INT", cols[0].SQLType.Name)
}
cnt, err := testEngine.Insert(&UintId{Name: "test"}) cnt, err := testEngine.Insert(&UintId{Name: "test"})
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, 1, cnt) assert.EqualValues(t, 1, cnt)