mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
proxy: fix test
This commit is contained in:
parent
0a3a2720a1
commit
612ecbc89d
@ -17,6 +17,7 @@ package proxy
|
|||||||
import (
|
import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,11 +54,14 @@ func TestNewDirectorScheme(t *testing.T) {
|
|||||||
}
|
}
|
||||||
got := newDirector(uf)
|
got := newDirector(uf)
|
||||||
|
|
||||||
for ii, wep := range tt.want {
|
var gep []string
|
||||||
gep := got.ep[ii].URL.String()
|
for _, ep := range got.ep {
|
||||||
if !reflect.DeepEqual(wep, gep) {
|
gep = append(gep, ep.URL.String())
|
||||||
t.Errorf("#%d: want endpoints[%d] = %#v, got = %#v", i, ii, wep, gep)
|
|
||||||
}
|
}
|
||||||
|
sort.Strings(tt.want)
|
||||||
|
sort.Strings(gep)
|
||||||
|
if !reflect.DeepEqual(tt.want, gep) {
|
||||||
|
t.Errorf("#%d: want endpoints = %#v, got = %#v", i, tt.want, gep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user