From 387c003c427fa32c39cc3f383c5cb36d4582c50a Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 5 Jun 2024 13:36:49 +0200 Subject: [PATCH] update test for replacement scan on range --- replacement_scan_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/replacement_scan_test.go b/replacement_scan_test.go index aba9eb31..5fdf334a 100644 --- a/replacement_scan_test.go +++ b/replacement_scan_test.go @@ -18,7 +18,7 @@ func TestReplacementScan(t *testing.T) { } defer connector.Close() - var rangeRows = 3 + var rangeRows = 100 RegisterReplacementScan(connector, func(tableName string) (string, []any, error) { return "range", []any{int64(rangeRows)}, nil }) @@ -31,15 +31,19 @@ func TestReplacementScan(t *testing.T) { } defer rows.Close() - for rows.Next() { + for i := 0; rows.Next(); i++ { + var val int + require.NoError(t, rows.Scan(&val)) + if val != i { + require.Fail(t, "expected %d, got %d", i, val) + } rangeRows-- } if rows.Err() != nil { require.NoError(t, rows.Err()) } - if rangeRows != 0 { - t.Fatalf("expected 0 rows, got %d", rangeRows) + require.Fail(t, "expected 0, got %d", rangeRows) } }