Skip to content

Commit f27a0c4

Browse files
author
Philio
committed
fixed TestSimple unit test
1 parent 2c65a22 commit f27a0c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mysql_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ func TestSimple(t *testing.T) {
170170
if row == nil {
171171
break
172172
}
173-
id, _ := strconv.Atoui64(string(row[0].([]byte)))
174-
num, str1, str2 := string(row[1].([]byte)), string(row[2].([]byte)), string(row[3].([]byte))
173+
id := row[0].(uint64)
174+
num, str1, str2 := strconv.Itoa64(row[1].(int64)), string(row[2].([]byte)), string(row[3].([]byte))
175175
if rowMap[id][0] != num || rowMap[id][1] != str1 || rowMap[id][2] != str2 {
176176
t.Logf("String from database doesn't match local string")
177177
t.Fail()
@@ -214,8 +214,8 @@ func TestSimple(t *testing.T) {
214214
if row == nil {
215215
break
216216
}
217-
id, _ := strconv.Atoui64(string(row[0].([]byte)))
218-
num, str1, str2 := string(row[1].([]byte)), string(row[2].([]byte)), string(row[3].([]byte))
217+
id := row[0].(uint64)
218+
num, str1, str2 := strconv.Itoa64(row[1].(int64)), string(row[2].([]byte)), string(row[3].([]byte))
219219
if rowMap[id][0] != num || rowMap[id][1] != str1 || rowMap[id][2] != str2 {
220220
t.Logf("%#v %#v", rowMap[id], row)
221221
t.Logf("String from database doesn't match local string")

0 commit comments

Comments
 (0)