mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-11 21:49:13 +00:00
Go 1.22.
This commit is contained in:
@@ -365,7 +365,7 @@ func TestBlob_Reopen(t *testing.T) {
|
||||
}
|
||||
|
||||
var rowids []int64
|
||||
for i := 0; i < 100; i++ {
|
||||
for range 100 {
|
||||
err = db.Exec(`INSERT INTO test VALUES (zeroblob(10))`)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
@@ -92,7 +92,7 @@ func testManyQueryRow(t params) {
|
||||
t.mustExec("create table " + TablePrefix + "foo (id integer primary key, name varchar(50))")
|
||||
t.mustExec("insert into "+TablePrefix+"foo (id, name) values(?,?)", 1, "bob")
|
||||
var name string
|
||||
for i := 0; i < 10000; i++ {
|
||||
for i := range 10000 {
|
||||
err := t.QueryRow("select name from "+TablePrefix+"foo where id = ?", 1).Scan(&name)
|
||||
if err != nil || name != "bob" {
|
||||
t.Fatalf("on query %d: err=%v, name=%q", i, err, name)
|
||||
@@ -164,11 +164,11 @@ func testPreparedStmt(t params) {
|
||||
|
||||
const nRuns = 10
|
||||
var wg sync.WaitGroup
|
||||
for i := 0; i < nRuns; i++ {
|
||||
for range nRuns {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for j := 0; j < 10; j++ {
|
||||
for range 10 {
|
||||
count := 0
|
||||
if err := sel.QueryRow().Scan(&count); err != nil && err != sql.ErrNoRows {
|
||||
t.Errorf("Query: %v", err)
|
||||
|
||||
@@ -372,7 +372,7 @@ func testParallel(t testing.TB, name string, n int) {
|
||||
|
||||
var group errgroup.Group
|
||||
group.SetLimit(6)
|
||||
for i := 0; i < n; i++ {
|
||||
for i := range n {
|
||||
if i&7 != 7 {
|
||||
group.Go(reader)
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"math"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -52,8 +51,7 @@ func TestQuote(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
got := sqlite3.Quote(tt.val)
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
if got := sqlite3.Quote(tt.val); got != tt.want {
|
||||
t.Errorf("Quote(%v) = %q, want %q", tt.val, got, tt.want)
|
||||
}
|
||||
})
|
||||
@@ -81,8 +79,7 @@ func TestQuoteIdentifier(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
got := sqlite3.QuoteIdentifier(tt.id)
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
if got := sqlite3.QuoteIdentifier(tt.id); got != tt.want {
|
||||
t.Errorf("QuoteIdentifier(%v) = %q, want %q", tt.id, got, tt.want)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user