]> Sergey Matveev's repositories - btrtrc.git/blob - storage/mmap_test.go
Fixes for storage tests on Windows
[btrtrc.git] / storage / mmap_test.go
1 package storage
2
3 import (
4         "testing"
5
6         qt "github.com/frankban/quicktest"
7
8         "github.com/anacrolix/torrent/internal/testutil"
9 )
10
11 func TestMmapWindows(t *testing.T) {
12         c := qt.New(t)
13         dir, mi := testutil.GreetingTestTorrent()
14         cs := NewMMap(dir)
15         defer func() {
16                 c.Check(cs.Close(), qt.IsNil)
17         }()
18         info, err := mi.UnmarshalInfo()
19         c.Assert(err, qt.IsNil)
20         ts, err := cs.OpenTorrent(&info, mi.HashInfoBytes())
21         c.Assert(err, qt.IsNil)
22         defer func() {
23                 c.Check(ts.Close(), qt.IsNil)
24         }()
25 }