Feat: new changes in pkg: chunk, backoff, local, onedrive

This commit is contained in:
HFO4
2022-03-27 11:14:30 +08:00
parent 31315c86ee
commit c6130ab078
10 changed files with 533 additions and 233 deletions

View File

@@ -0,0 +1,22 @@
package backoff
import (
"github.com/stretchr/testify/assert"
"testing"
"time"
)
func TestConstantBackoff_Next(t *testing.T) {
a := assert.New(t)
b := &ConstantBackoff{Sleep: time.Duration(0), Max: 3}
a.True(b.Next())
a.True(b.Next())
a.True(b.Next())
a.False(b.Next())
b.Reset()
a.True(b.Next())
a.True(b.Next())
a.True(b.Next())
a.False(b.Next())
}