24 lines
516 B
Go
24 lines
516 B
Go
package db
|
|
|
|
import "testing"
|
|
|
|
func TestDriverNameNormalization(t *testing.T) {
|
|
var got string
|
|
got = driverName("sqlite3")
|
|
if got != "sqlite" {
|
|
t.Fatalf("sqlite3 normalize failed: %s", got)
|
|
}
|
|
got = driverName(" PostgreSQL ")
|
|
if got != "postgres" {
|
|
t.Fatalf("postgres normalize failed: %s", got)
|
|
}
|
|
got = driverName("mysql")
|
|
if got != "mysql" {
|
|
t.Fatalf("mysql normalize failed: %s", got)
|
|
}
|
|
got = driverName("custom")
|
|
if got != "custom" {
|
|
t.Fatalf("custom driver should pass through: %s", got)
|
|
}
|
|
}
|