mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 08:00:04 +01:00
Initial commit
This commit is contained in:
commit
9cfc758ca1
14 changed files with 697 additions and 0 deletions
24
driver/shared/shared_test.go
Normal file
24
driver/shared/shared_test.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package shared_test
|
||||
|
||||
import (
|
||||
"github.com/adrianmacneil/dbmate/driver/shared"
|
||||
"github.com/stretchr/testify/require"
|
||||
"net/url"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDatabaseName(t *testing.T) {
|
||||
u, err := url.Parse("ignore://localhost/foo?query")
|
||||
require.Nil(t, err)
|
||||
|
||||
name := shared.DatabaseName(u)
|
||||
require.Equal(t, "foo", name)
|
||||
}
|
||||
|
||||
func TestDatabaseName_Empty(t *testing.T) {
|
||||
u, err := url.Parse("ignore://localhost")
|
||||
require.Nil(t, err)
|
||||
|
||||
name := shared.DatabaseName(u)
|
||||
require.Equal(t, "", name)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue