aboutsummaryrefslogtreecommitdiff
path: root/sqlite3_test.go
diff options
context:
space:
mode:
authorEvan Jones <evan.jones@datadoghq.com>2020-11-16 11:52:26 -0500
committerGitHub <noreply@github.com>2020-11-17 01:52:26 +0900
commit70c77097f2f2a8c57fa2c898284e9cfb80173eb2 (patch)
treec15790079a5db7e927020a0a7585126f6fcf2584 /sqlite3_test.go
parentdoc.go: you can use Conn.Raw to get *SQLiteConn (#882) (diff)
downloadgolite-70c77097f2f2a8c57fa2c898284e9cfb80173eb2.tar.gz
golite-70c77097f2f2a8c57fa2c898284e9cfb80173eb2.tar.xz
sqlite3_test.go: Move Go 1.13 test to sqlite3_go113_test.go (#883)
Commit 4f7abea96e added a test that uses Conn.Raw, which was added in Go >= 1.13. The go-sqlite3 project runs tests with Go >= 1.11. Remove the test from sqlite3_test.go, so it only runs with the correct versions of Go. Instead of adding a new test, modify the existing test that already uses Conn.Raw() to check the type of driverConn.
Diffstat (limited to 'sqlite3_test.go')
-rw-r--r--sqlite3_test.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/sqlite3_test.go b/sqlite3_test.go
index fe367cf..d5b0cea 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -9,7 +9,6 @@ package sqlite3
import (
"bytes"
- "context"
"database/sql"
"database/sql/driver"
"errors"
@@ -2353,32 +2352,3 @@ func benchmarkStmtRows(b *testing.B) {
}
}
}
-
-func TestConnRawIsSQLiteConn(t *testing.T) {
- db, err := sql.Open("sqlite3", ":memory:")
- if err != nil {
- t.Fatal("Failed to open db:", err)
- }
- defer db.Close()
-
- conn, err := db.Conn(context.Background())
- if err != nil {
- t.Fatal("Failed to get conn:", err)
- }
- defer conn.Close()
- err = conn.Raw(func(driverConn interface{}) error {
- sqliteConn, ok := driverConn.(*SQLiteConn)
- if !ok {
- t.Errorf("driverConn type=%T; expected to be *SQLiteConn", driverConn)
- return nil
- }
- // call a private SQLite API to confirm the raw conn "works"
- if sqliteConn.AuthEnabled() {
- t.Error("sqliteConn.AuthEnabled()=true; expected false")
- }
- return nil
- })
- if err != nil {
- t.Error("conn.Raw() returned err:", err)
- }
-}