]> Sergey Matveev's repositories - btrtrc.git/blob - test_test.go
Drop support for go 1.20
[btrtrc.git] / test_test.go
1 package torrent
2
3 // Helpers for testing
4
5 import (
6         "testing"
7
8         "github.com/anacrolix/torrent/metainfo"
9 )
10
11 func newTestingClient(t testing.TB) *Client {
12         cl := new(Client)
13         cl.init(TestingConfig(t))
14         t.Cleanup(func() {
15                 cl.Close()
16         })
17         cl.initLogger()
18         return cl
19 }
20
21 func (cl *Client) newTorrentForTesting() *Torrent {
22         return cl.newTorrent(metainfo.Hash{}, nil)
23 }