* Add Test

#598
This commit is contained in:
Gert-Jan Timmer 2018-06-26 16:36:16 +02:00
parent d6c4423838
commit ca65b399cb
1 changed files with 13 additions and 0 deletions

View File

@ -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)