peers_test.go 339 B

12345678910111213141516171819
  1. package etcdhttp
  2. import "testing"
  3. //TODO: full testing for peer set
  4. func TestPeerSet(t *testing.T) {
  5. p := &Peers{}
  6. tests := []string{
  7. "1=1.1.1.1",
  8. "2=2.2.2.2",
  9. "1=1.1.1.1&1=1.1.1.2&2=2.2.2.2",
  10. }
  11. for i, tt := range tests {
  12. p.Set(tt)
  13. if p.String() != tt {
  14. t.Errorf("#%d: string = %s, want %s", i, p.String(), tt)
  15. }
  16. }
  17. }