2
0
mirror of synced 2025-02-23 22:28:11 +00:00
torrent/test_test.go
Matt Joiner 74c70d852a Add TestHaveAllThenBitfield
The result of a misguided attempt to reduce piece peer availability increment and decrement overhead for have all/full-bitfield and conn closes.
2021-12-23 14:00:00 +11:00

24 lines
364 B
Go

package torrent
// Helpers for testing
import (
"testing"
"github.com/anacrolix/torrent/metainfo"
)
func newTestingClient(t testing.TB) *Client {
cl := new(Client)
cl.init(TestingConfig(t))
t.Cleanup(func() {
cl.Close()
})
cl.initLogger()
return cl
}
func (cl *Client) newTorrentForTesting() *Torrent {
return cl.newTorrent(metainfo.Hash{}, nil)
}