Codebase list golang-github-vbauerster-mpb / ee6c2fd
TestWithNilContext Vladimir Bauer 9 years ago
1 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3737 t.Error("ProgressBar didn't stop")
3838 }
3939 }
40
41 func TestWithNilContext(t *testing.T) {
42 defer func() {
43 if p := recover(); p != nil {
44 if msg, ok := p.(string); ok && msg == "nil context" {
45 return
46 }
47 t.Errorf("Expected nil context panic, got: %+v", p)
48 }
49 }()
50 _ = mpb.New().WithContext(nil)
51 }