commit e4ad50b973973310a1823f00ea975697e93e3182
parent c26e0f9dab045063f9fb15a64233322532b18dcb
Author: Oliver Lowe <o@olowe.co>
Date: Thu, 3 Feb 2022 02:26:08 +1100
panic on unlikely test case
We're just in test mode, so it's ok to panic if we reach this highly unlikely
scenario when, for example, the testdata file changes or something.
Diffstat:
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/service_test.go b/service_test.go
@@ -27,12 +27,7 @@ func TestServiceUnmarshal(t *testing.T) {
Output: "HTTP OK: HTTP/1.1 200 OK - 1714 bytes in 1.083 second response time ",
},
}
- var got Service
- for _, r := range resp.Results {
- if r.name() == "9p.io!http" {
- got = r.(Service)
- }
- }
+ got := resp.Results[0].(Service)
if !reflect.DeepEqual(want, got) {
t.Errorf("want %+v, got %+v", want, got)
}