(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestContextDeadlineExceeded(t *testing.T) { |
| 97 | t.Parallel() |
| 98 | a := assertions.New(t) |
| 99 | |
| 100 | ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(5*time.Millisecond)) |
| 101 | defer cancel() |
| 102 | |
| 103 | <-ctx.Done() |
| 104 | |
| 105 | err, ok := errors.From(ctx.Err()) |
| 106 | if !a.So(ok, should.BeTrue) { |
| 107 | t.FailNow() |
| 108 | } |
| 109 | a.So(errors.IsDeadlineExceeded(err), should.BeTrue) |
| 110 | } |
| 111 | |
| 112 | func TestNetErrors(t *testing.T) { |
| 113 | t.Parallel() |