mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-31 16:21:21 +00:00
22 lines
548 B
Go
22 lines
548 B
Go
package cli
|
|
|
|
import (
|
|
"net/url"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestParseSocketUrl(t *testing.T) {
|
|
t.Run("sock", func(t *testing.T) {
|
|
socketUrl, err := url.Parse("unix:///some/file/path.sock")
|
|
require.NoError(t, err)
|
|
require.EqualValues(t, "/some/file/path.sock", socketUrl.Host+socketUrl.EscapedPath())
|
|
})
|
|
t.Run("sock", func(t *testing.T) {
|
|
socketUrl, err := url.Parse("tcp://localhost:1234")
|
|
require.NoError(t, err)
|
|
require.EqualValues(t, "localhost:1234", socketUrl.Host+socketUrl.EscapedPath())
|
|
})
|
|
}
|