From 226d9033a381665aea6f2f2ced4da25f56cd33f5 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 15 Nov 2019 16:49:01 +0100 Subject: [PATCH] Add test for successful execution Signed-off-by: Knut Ahlers --- backoff/backoff_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backoff/backoff_test.go b/backoff/backoff_test.go index f820c41..27f1c2a 100644 --- a/backoff/backoff_test.go +++ b/backoff/backoff_test.go @@ -53,6 +53,17 @@ func TestMaxIterations(t *testing.T) { } } +func TestSuccessfulExecution(t *testing.T) { + b := NewBackoff() + b.MaxIterations = 5 + + err := b.Retry(func() error { return nil }) + + if err != nil { + t.Errorf("An error was thrown: %s", err) + } +} + func TestWrappedError(t *testing.T) { b := NewBackoff() b.MaxIterations = 5