From 5380f4372e1def6d9332fe2749d49d2d8af8c48f Mon Sep 17 00:00:00 2001 From: Xin Hao Date: Fri, 19 Jan 2024 02:31:10 +0800 Subject: [PATCH] Add more tests for ResultSet Scan --- result_set_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/result_set_test.go b/result_set_test.go index 48c69405..91585f5c 100644 --- a/result_set_test.go +++ b/result_set_test.go @@ -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) {