diff --git a/progress_go1.7_test.go b/progress_go1.7_test.go index b7ede0c..7ba7933 100644 --- a/progress_go1.7_test.go +++ b/progress_go1.7_test.go @@ -38,3 +38,15 @@ t.Error("ProgressBar didn't stop") } } + +func TestWithNilContext(t *testing.T) { + defer func() { + if p := recover(); p != nil { + if msg, ok := p.(string); ok && msg == "nil context" { + return + } + t.Errorf("Expected nil context panic, got: %+v", p) + } + }() + _ = mpb.New().WithContext(nil) +}