Skip to content

Commit

Permalink
deadline test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhicks committed Oct 10, 2024
1 parent 60f1b05 commit 54cd813
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ func TestWaitFor(t *testing.T) {
},
expErr: context.Canceled,
},
{
name: "time out",
ctx: func(t *testing.T) context.Context {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
t.Cleanup(cancel)
return ctx
},
ch: func(t *testing.T) chan int {
return nil
},
expErr: context.DeadlineExceeded,
},
{
name: "success",
ctx: func(t *testing.T) context.Context {
Expand Down

0 comments on commit 54cd813

Please sign in to comment.