X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=issue211_test.go;h=7794f8a50137974993485f57d1a14f30f3d5a913;hb=5380337f869ed630e1102036bf6dec48c044152a;hp=c12a9c9e303714a81de7d603cbe0cd6af978b336;hpb=fc4fab91f52944cf68d48193d827d8e762810414;p=btrtrc.git diff --git a/issue211_test.go b/issue211_test.go index c12a9c9e..7794f8a5 100644 --- a/issue211_test.go +++ b/issue211_test.go @@ -1,3 +1,6 @@ +//go:build !wasm +// +build !wasm + package torrent import ( @@ -5,15 +8,16 @@ import ( "io/ioutil" "testing" - "github.com/anacrolix/torrent/internal/testutil" - "github.com/anacrolix/torrent/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/time/rate" + + "github.com/anacrolix/torrent/internal/testutil" + "github.com/anacrolix/torrent/storage" ) func TestDropTorrentWithMmapStorageWhileHashing(t *testing.T) { - cfg := TestingConfig() + cfg := TestingConfig(t) // Ensure the data is present when the torrent is added, and not obtained // over the network as the test runs. cfg.DownloadRateLimiter = rate.NewLimiter(0, 0) @@ -22,8 +26,10 @@ func TestDropTorrentWithMmapStorageWhileHashing(t *testing.T) { defer cl.Close() td, mi := testutil.GreetingTestTorrent() + mms := storage.NewMMap(td) + defer mms.Close() tt, new, err := cl.AddTorrentSpec(&TorrentSpec{ - Storage: storage.NewMMap(td), + Storage: mms, InfoHash: mi.HashInfoBytes(), InfoBytes: mi.InfoBytes, })