Skip to content

Commit

Permalink
👷 Improve test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyonlin committed Feb 22, 2021
1 parent f9d1074 commit 9bcfb51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,14 +990,14 @@ func Test_Client_Agent_Struct(t *testing.T) {
a := Get("http://example.com")

a.HostClient.Dial = func(addr string) (net.Conn, error) { return ln.Dial() }
a.errs = append(a.errs, errors.New("pre errors"))

var d data

_, body, errs := a.Timeout(time.Nanosecond).Struct(&d)
_, body, errs := a.Struct(&d)

utils.AssertEqual(t, "", string(body))
utils.AssertEqual(t, 1, len(errs))
utils.AssertEqual(t, "timeout", errs[0].Error())
utils.AssertEqual(t, "pre errors", errs[0].Error())
utils.AssertEqual(t, false, d.Success)
})

Expand Down

0 comments on commit 9bcfb51

Please sign in to comment.