This commit is contained in:
bel
2020-01-13 03:37:51 +00:00
commit c8eb52f9ba
2023 changed files with 702080 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package pacer
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTokenDispenser(t *testing.T) {
td := NewTokenDispenser(5)
assert.Equal(t, 5, len(td.tokens))
td.Get()
assert.Equal(t, 4, len(td.tokens))
td.Put()
assert.Equal(t, 5, len(td.tokens))
}