Fix failing win test
This commit is contained in:
parent
dc4e8598f7
commit
fc380df8dd
@ -2,6 +2,7 @@ package connection
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
"os/user"
|
"os/user"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -140,9 +141,10 @@ func Test_No_User(t *testing.T) {
|
|||||||
opts := command.Options{Host: "host", Port: 5432, DbName: "db"}
|
opts := command.Options{Host: "host", Port: 5432, DbName: "db"}
|
||||||
u, _ := user.Current()
|
u, _ := user.Current()
|
||||||
str, err := BuildStringFromOptions(opts)
|
str, err := BuildStringFromOptions(opts)
|
||||||
|
userAndPass := url.UserPassword(u.Username, "").String()
|
||||||
|
|
||||||
assert.Equal(t, nil, err)
|
assert.Equal(t, nil, err)
|
||||||
assert.Equal(t, fmt.Sprintf("postgres://%s:@host:5432/db", u.Username), str)
|
assert.Equal(t, fmt.Sprintf("postgres://%s@host:5432/db", userAndPass), str)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_Port(t *testing.T) {
|
func Test_Port(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user