mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-13 00:20:04 +01:00
Flatten package layout
This commit is contained in:
parent
275f5791f4
commit
aa5757f8f9
13 changed files with 193 additions and 239 deletions
26
driver_test.go
Normal file
26
driver_test.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetDriver_Postgres(t *testing.T) {
|
||||
drv, err := GetDriver("postgres")
|
||||
require.Nil(t, err)
|
||||
_, ok := drv.(PostgresDriver)
|
||||
require.Equal(t, true, ok)
|
||||
}
|
||||
|
||||
func TestGetDriver_MySQL(t *testing.T) {
|
||||
drv, err := GetDriver("mysql")
|
||||
require.Nil(t, err)
|
||||
_, ok := drv.(MySQLDriver)
|
||||
require.Equal(t, true, ok)
|
||||
}
|
||||
|
||||
func TestGetDriver_Error(t *testing.T) {
|
||||
drv, err := GetDriver("foo")
|
||||
require.Equal(t, "Unknown driver: foo", err.Error())
|
||||
require.Nil(t, drv)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue