mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 08:00:04 +01:00
Flatten package layout
This commit is contained in:
parent
275f5791f4
commit
aa5757f8f9
13 changed files with 193 additions and 239 deletions
23
utils_test.go
Normal file
23
utils_test.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"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 := databaseName(u)
|
||||
require.Equal(t, "foo", name)
|
||||
}
|
||||
|
||||
func TestDatabaseName_Empty(t *testing.T) {
|
||||
u, err := url.Parse("ignore://localhost")
|
||||
require.Nil(t, err)
|
||||
|
||||
name := databaseName(u)
|
||||
require.Equal(t, "", name)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue