package torrent
import (
- "sync"
"testing"
"github.com/anacrolix/torrent/peer_protocol"
}
}
-func TestTorrentDoubleClose(t *testing.T) {
- tt, err := newTorrent(InfoHash{})
- if err != nil {
- t.Fatal(err)
- }
- wg := sync.WaitGroup{}
- for i := 0; i < 2; i++ {
- wg.Add(1)
- go func() {
- tt.close()
- wg.Done()
- }()
- }
- wg.Wait()
-}
-
func TestAppendToCopySlice(t *testing.T) {
orig := []int{1, 2, 3}
dupe := append([]int{}, orig...)