mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-01-17 03:10:10 +08:00
27 lines
556 B
Go
27 lines
556 B
Go
package pstoremem
|
|
|
|
import (
|
|
"testing"
|
|
|
|
pstore "github.com/libp2p/go-libp2p-peerstore"
|
|
"github.com/libp2p/go-libp2p-peerstore/test"
|
|
)
|
|
|
|
func TestInMemoryPeerstore(t *testing.T) {
|
|
test.TestPeerstore(t, func() (pstore.Peerstore, func()) {
|
|
return NewPeerstore(), nil
|
|
})
|
|
}
|
|
|
|
func TestInMemoryAddrBook(t *testing.T) {
|
|
test.TestAddrBook(t, func() (pstore.AddrBook, func()) {
|
|
return NewAddrBook(), nil
|
|
})
|
|
}
|
|
|
|
func BenchmarkInMemoryPeerstore(b *testing.B) {
|
|
test.BenchmarkPeerstore(b, func() (pstore.Peerstore, func()) {
|
|
return NewPeerstore(), nil
|
|
})
|
|
}
|