mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
a987512c7b
* feat: more meaningful error messages, close body on httpc requests * fix: test failure
18 lines
457 B
Go
18 lines
457 B
Go
package resolver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestBuildDirectTarget(t *testing.T) {
|
|
target := BuildDirectTarget([]string{"localhost:123", "localhost:456"})
|
|
assert.Equal(t, "direct:///localhost:123,localhost:456", target)
|
|
}
|
|
|
|
func TestBuildDiscovTarget(t *testing.T) {
|
|
target := BuildDiscovTarget([]string{"localhost:123", "localhost:456"}, "foo")
|
|
assert.Equal(t, "etcd://localhost:123,localhost:456/foo", target)
|
|
}
|