6 "bitbucket.org/anacrolix/go.torrent/testutil"
11 func TestAddTorrentNoSupportedTrackerSchemes(t *testing.T) {
15 func TestAddTorrentNoUsableURLs(t *testing.T) {
19 func TestAddPeersToUnknownTorrent(t *testing.T) {
23 func TestPieceHashSize(t *testing.T) {
24 if PieceHash.Size() != 20 {
29 func TestTorrentInitialState(t *testing.T) {
30 dir, mi := testutil.GreetingTestTorrent()
31 defer os.RemoveAll(dir)
32 tor, err := newTorrent(mi, dir)
36 if len(tor.Pieces) != 1 {
37 t.Fatal("wrong number of pieces")
40 if len(p.PendingChunkSpecs) != 1 {
41 t.Fatalf("should only be 1 chunk: %s", p.PendingChunkSpecs)
43 if _, ok := p.PendingChunkSpecs[ChunkSpec{
46 t.Fatal("pending chunk spec is incorrect")