(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestGetSRVService(t *testing.T) { |
| 270 | tests := []struct { |
| 271 | scheme string |
| 272 | serviceName string |
| 273 | |
| 274 | expected string |
| 275 | }{ |
| 276 | { |
| 277 | "https", |
| 278 | "", |
| 279 | "etcd-client-ssl", |
| 280 | }, |
| 281 | { |
| 282 | "http", |
| 283 | "", |
| 284 | "etcd-client", |
| 285 | }, |
| 286 | { |
| 287 | "https", |
| 288 | "foo", |
| 289 | "etcd-client-ssl-foo", |
| 290 | }, |
| 291 | { |
| 292 | "http", |
| 293 | "bar", |
| 294 | "etcd-client-bar", |
| 295 | }, |
| 296 | } |
| 297 | |
| 298 | for i, tt := range tests { |
| 299 | service := GetSRVService("etcd-client", tt.serviceName, tt.scheme) |
| 300 | if strings.Compare(service, tt.expected) != 0 { |
| 301 | t.Errorf("#%d: service = %s, want %s", i, service, tt.expected) |
| 302 | } |
| 303 | } |
| 304 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…