forked from mirror/go-sqlite3
parent
d6c4423838
commit
ca65b399cb
|
@ -12,6 +12,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"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) {
|
func TestOpenDB(t *testing.T) {
|
||||||
tempFilename := TempFilename(t)
|
tempFilename := TempFilename(t)
|
||||||
defer os.Remove(tempFilename)
|
defer os.Remove(tempFilename)
|
||||||
|
|
Loading…
Reference in New Issue