chore: make CatchPanics an option flag

This commit is contained in:
Christian Muehlhaeuser
2022-10-07 21:48:50 +02:00
parent 0ac6702e11
commit 76ce669474
3 changed files with 22 additions and 24 deletions

View File

@@ -25,13 +25,6 @@ func TestOptions(t *testing.T) {
}
})
t.Run("catch panics", func(t *testing.T) {
p := NewProgram(nil, WithoutCatchPanics())
if p.CatchPanics {
t.Errorf("catch panics should not have been set")
}
})
t.Run("renderer", func(t *testing.T) {
p := NewProgram(nil, WithoutRenderer())
switch p.renderer.(type) {
@@ -62,6 +55,10 @@ func TestOptions(t *testing.T) {
exercise(t, WithANSICompressor(), withANSICompressor)
})
t.Run("without catch panics", func(t *testing.T) {
exercise(t, WithoutCatchPanics(), withoutCatchPanics)
})
t.Run("without signal handler", func(t *testing.T) {
exercise(t, WithoutSignalHandler(), withoutSignalHandler)
})