forked from mirror/go-sqlite3
parent
d6c4423838
commit
ca65b399cb
|
@ -12,6 +12,7 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
@ -50,6 +51,18 @@ func TestOpenConnector(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestOpenConnectorInvalidDSN(t *testing.T) {
|
||||
tempFilename := TempFilename(t)
|
||||
defer os.Remove(tempFilename)
|
||||
|
||||
drv := &SQLiteDriver{}
|
||||
|
||||
_, err := drv.OpenConnector(fmt.Sprintf("file:%s?%35%2%%43?test=false", tempFilename))
|
||||
if err == nil {
|
||||
t.Fatal("Opened connector while error was expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOpenDB(t *testing.T) {
|
||||
tempFilename := TempFilename(t)
|
||||
defer os.Remove(tempFilename)
|
||||
|
|
Loading…
Reference in New Issue