]> Sergey Matveev's repositories - btrtrc.git/blobdiff - storage/mmap_test.go
Fixes for storage tests on Windows
[btrtrc.git] / storage / mmap_test.go
diff --git a/storage/mmap_test.go b/storage/mmap_test.go
new file mode 100644 (file)
index 0000000..54260ec
--- /dev/null
@@ -0,0 +1,25 @@
+package storage
+
+import (
+       "testing"
+
+       qt "github.com/frankban/quicktest"
+
+       "github.com/anacrolix/torrent/internal/testutil"
+)
+
+func TestMmapWindows(t *testing.T) {
+       c := qt.New(t)
+       dir, mi := testutil.GreetingTestTorrent()
+       cs := NewMMap(dir)
+       defer func() {
+               c.Check(cs.Close(), qt.IsNil)
+       }()
+       info, err := mi.UnmarshalInfo()
+       c.Assert(err, qt.IsNil)
+       ts, err := cs.OpenTorrent(&info, mi.HashInfoBytes())
+       c.Assert(err, qt.IsNil)
+       defer func() {
+               c.Check(ts.Close(), qt.IsNil)
+       }()
+}