]> Sergey Matveev's repositories - btrtrc.git/blobdiff - internal/testutil/spec.go
fix: can not download invalid utf8 name with BestName and BestPath (#915)
[btrtrc.git] / internal / testutil / spec.go
index 63e4a74c633f646bdb1efa7c1607684cf0b807d9..ad0e4074def5b72c06f825f26969a13b5fb7762f 100644 (file)
@@ -52,7 +52,7 @@ func (t *Torrent) Info(pieceLength int64) metainfo.Info {
                }
        }
        err := info.GeneratePieces(func(fi metainfo.FileInfo) (io.ReadCloser, error) {
-               return io.NopCloser(strings.NewReader(t.GetFile(strings.Join(fi.Path, "/")).Data)), nil
+               return io.NopCloser(strings.NewReader(t.GetFile(strings.Join(fi.BestPath(), "/")).Data)), nil
        })
        expect.Nil(err)
        return info