File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,20 @@ func BenchmarkDo(b *testing.B) {
553
553
}
554
554
}
555
555
556
+ func BenchmarkDoWithData (b * testing.B ) {
557
+ testError := errors .New ("test error" )
558
+
559
+ for i := 0 ; i < b .N ; i ++ {
560
+ _ , _ = DoWithData (
561
+ func () (int , error ) {
562
+ return 0 , testError
563
+ },
564
+ Attempts (10 ),
565
+ Delay (0 ),
566
+ )
567
+ }
568
+ }
569
+
556
570
func BenchmarkDoNoErrors (b * testing.B ) {
557
571
for i := 0 ; i < b .N ; i ++ {
558
572
_ = Do (
@@ -565,6 +579,18 @@ func BenchmarkDoNoErrors(b *testing.B) {
565
579
}
566
580
}
567
581
582
+ func BenchmarkDoWithDataNoErrors (b * testing.B ) {
583
+ for i := 0 ; i < b .N ; i ++ {
584
+ _ , _ = DoWithData (
585
+ func () (int , error ) {
586
+ return 0 , nil
587
+ },
588
+ Attempts (10 ),
589
+ Delay (0 ),
590
+ )
591
+ }
592
+ }
593
+
568
594
func TestIsRecoverable (t * testing.T ) {
569
595
err := errors .New ("err" )
570
596
assert .True (t , IsRecoverable (err ))
You can’t perform that action at this time.
0 commit comments