6b4dd5703e
There are no changes visible from the user side (at least for those users who doesn't put Prometheus's or pprof's port in quotes), just internal refactoring. From now and on, BasicService configuration is used by RPC server config, TLS for RPC server, pprof and Prometheus.
19 lines
415 B
Go
19 lines
415 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestBasicService_FormatAddress(t *testing.T) {
|
|
for expected, tc := range map[string]BasicService{
|
|
"localhost:10332": {Address: "localhost", Port: 10332},
|
|
"127.0.0.1:0": {Address: "127.0.0.1"},
|
|
":0": {},
|
|
} {
|
|
t.Run(expected, func(t *testing.T) {
|
|
require.Equal(t, expected, tc.FormatAddress())
|
|
})
|
|
}
|
|
}
|