mirror of
https://github.com/Luzifer/go_helpers.git
synced 2024-12-25 05:21:20 +00:00
Add test for successful execution
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e3143a022a
commit
226d9033a3
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue