]> Sergey Matveev's repositories - btrtrc.git/blobdiff - issue97_test.go
Drop support for go 1.20
[btrtrc.git] / issue97_test.go
index 5ccfa62e6a9d00f4a99d3f6a6d2c693115866e12..ee8107c6dd82309d443b47f21db07f629aac8867 100644 (file)
@@ -1,10 +1,9 @@
 package torrent
 
 import (
-       "io/ioutil"
-       "os"
        "testing"
 
+       "github.com/anacrolix/log"
        "github.com/stretchr/testify/require"
 
        "github.com/anacrolix/torrent/internal/testutil"
@@ -12,11 +11,13 @@ import (
 )
 
 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()