github.com/lingyao2333/mo-zero@v1.4.1/zrpc/resolver/target_test.go (about)

     1  package resolver
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestBuildDirectTarget(t *testing.T) {
    10  	target := BuildDirectTarget([]string{"localhost:123", "localhost:456"})
    11  	assert.Equal(t, "direct:///localhost:123,localhost:456", target)
    12  }
    13  
    14  func TestBuildDiscovTarget(t *testing.T) {
    15  	target := BuildDiscovTarget([]string{"localhost:123", "localhost:456"}, "foo")
    16  	assert.Equal(t, "etcd://localhost:123,localhost:456/foo", target)
    17  }