mirror of
https://github.com/containous/traefik.git
synced 2025-01-12 09:17:54 +03:00
17 lines
312 B
Go
17 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)
|
||
|
}
|
||
|
}
|