8 "github.com/stretchr/testify/require"
10 "github.com/anacrolix/torrent/internal/testutil"
11 "github.com/anacrolix/torrent/storage"
14 func TestHashPieceAfterStorageClosed(t *testing.T) {
15 td, err := ioutil.TempDir("", "")
16 require.NoError(t, err)
17 defer os.RemoveAll(td)
18 cs := storage.NewFile(td)
20 mi := testutil.GreetingMetaInfo()
21 info := mi.UnmarshalInfo()
24 tt.storage, err = cs.OpenTorrent(tt.info, mi.HashInfoBytes())
25 require.NoError(t, err)
26 require.NoError(t, tt.storage.Close())