]> Sergey Matveev's repositories - btrtrc.git/blobdiff - issue97_test.go
Drop support for go 1.20
[btrtrc.git] / issue97_test.go
index 5f36e67f68808927d9922f2efa21335917712148..ee8107c6dd82309d443b47f21db07f629aac8867 100644 (file)
@@ -1,21 +1,23 @@
 package torrent
 
 import (
-       "io/ioutil"
-       "os"
        "testing"
 
+       "github.com/anacrolix/log"
+       "github.com/stretchr/testify/require"
+
        "github.com/anacrolix/torrent/internal/testutil"
        "github.com/anacrolix/torrent/storage"
-       "github.com/stretchr/testify/require"
 )
 
 func TestHashPieceAfterStorageClosed(t *testing.T) {
-       td, err := ioutil.TempDir("", "")
-       require.NoError(t, err)
-       defer os.RemoveAll(td)
+       td := t.TempDir()
+       cs := storage.NewFile(td)
+       defer cs.Close()
        tt := &Torrent{
-               storageOpener: storage.NewClient(storage.NewFile(td)),
+               storageOpener: storage.NewClient(cs),
+               logger:        log.Default,
+               chunkSize:     defaultChunkSize,
        }
        mi := testutil.GreetingMetaInfo()
        info, err := mi.UnmarshalInfo()