traefik/safe/routine_test.go
2017-02-03 09:46:27 +01:00

16 lines
312 B
Go

package safe
import (
"github.com/cenk/backoff"
"testing"
)
func TestOperationWithRecover(t *testing.T) {
operation := func() error {
panic("BOOM")
}
err := backoff.Retry(OperationWithRecover(operation), &backoff.StopBackOff{})
if err == nil {
t.Fatalf("Error in OperationWithRecover: %s", err)
}
}