@@ -139,7 +139,7 @@ func parseDSN(dsn string) (string, string, error) {
|
|||||||
// Treat the DSN as the URL that it is.
|
// Treat the DSN as the URL that it is.
|
||||||
s := strings.SplitN(dsn, "://", 2)
|
s := strings.SplitN(dsn, "://", 2)
|
||||||
if len(s) != 2 {
|
if len(s) != 2 {
|
||||||
errors.New("failed to parse DSN as URL")
|
return "", "", errors.New("failed to parse DSN as URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
scheme := s[0]
|
scheme := s[0]
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ func TestDatabaseStoreNew(t *testing.T) {
|
|||||||
t.Run("invalid url", func(t *testing.T) {
|
t.Run("invalid url", func(t *testing.T) {
|
||||||
_, err := config.NewDatabaseStore("")
|
_, err := config.NewDatabaseStore("")
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|
||||||
|
_, err = config.NewDatabaseStore("mysql")
|
||||||
|
require.Error(t, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("unsupported scheme", func(t *testing.T) {
|
t.Run("unsupported scheme", func(t *testing.T) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user