Skip to content

Commit

Permalink
Add more tests for ResultSet Scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Hao committed Jan 15, 2024
1 parent 3fe0bb1 commit 53ac4d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions result_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,17 @@ func TestScan(t *testing.T) {
assert.Equal(t, 1, len(testStructList))
assert.Equal(t, int64(1), testStructList[0].Col0)
assert.Equal(t, "value1", testStructList[0].Col1)

// Scan again should work
err = resultSet.Scan(&testStructList)
if err != nil {
t.Error(err)
}
assert.Equal(t, 2, len(testStructList))
assert.Equal(t, int64(1), testStructList[0].Col0)
assert.Equal(t, "value1", testStructList[0].Col1)
assert.Equal(t, int64(1), testStructList[1].Col0)
assert.Equal(t, "value1", testStructList[1].Col1)
}

func TestIntVid(t *testing.T) {
Expand Down

0 comments on commit 53ac4d4

Please sign in to comment.