1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package memory_test
import (
"testing"
"time"
"github.com/ulule/limiter/v3"
"github.com/ulule/limiter/v3/drivers/store/memory"
"github.com/ulule/limiter/v3/drivers/store/tests"
)
func TestMemoryStoreSequentialAccess(t *testing.T) {
tests.TestStoreSequentialAccess(t, memory.NewStoreWithOptions(limiter.StoreOptions{
Prefix: "limiter:memory:sequential",
CleanUpInterval: 30 * time.Second,
}))
}
func TestMemoryStoreConcurrentAccess(t *testing.T) {
tests.TestStoreConcurrentAccess(t, memory.NewStoreWithOptions(limiter.StoreOptions{
Prefix: "limiter:memory:concurrent",
CleanUpInterval: 1 * time.Nanosecond,
}))
}
|