1
0
Fork 0
mirror of https://github.com/Luzifer/go_helpers.git synced 2024-12-25 13:31:21 +00:00

Add test for successful execution

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-11-15 16:49:01 +01:00
parent e3143a022a
commit 226d9033a3
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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) { func TestWrappedError(t *testing.T) {
b := NewBackoff() b := NewBackoff()
b.MaxIterations = 5 b.MaxIterations = 5