(t *testing.T)
| 381 | } |
| 382 | |
| 383 | func TestClientTypToStringConversion(t *testing.T) { |
| 384 | expectations := []struct { |
| 385 | in clientTyp |
| 386 | out string |
| 387 | }{ |
| 388 | {fhttp, "FastHTTP"}, |
| 389 | {nhttp1, "net/http v1.x"}, |
| 390 | {nhttp2, "net/http v2.0"}, |
| 391 | {42, "unknown client"}, |
| 392 | } |
| 393 | for _, exp := range expectations { |
| 394 | act := exp.in.String() |
| 395 | if act != exp.out { |
| 396 | t.Errorf("Expected %v, but got %v", exp.out, act) |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | func clientTypeFromString(s string) clientTyp { |
| 402 | switch s { |