target_test.go 459 B

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