Files
mochi/storage/memory/storage_test.go
2022-04-12 18:10:51 +03:00

27 lines
560 B
Go

package memory
import (
"testing"
"time"
"github.com/sot-tech/mochi/storage"
"github.com/sot-tech/mochi/storage/test"
)
func createNew() storage.Storage {
ps, err := New(Config{
ShardCount: 1024,
GarbageCollectionInterval: 10 * time.Minute,
PrometheusReportingInterval: 10 * time.Minute,
PeerLifetime: 30 * time.Minute,
})
if err != nil {
panic(err)
}
return ps
}
func TestStorage(t *testing.T) { test.RunTests(t, createNew()) }
func BenchmarkStorage(b *testing.B) { test.RunBenchmarks(b, createNew) }