"math/rand"
"strings"
+ "github.com/anacrolix/torrent/internal/testutil"
"github.com/anacrolix/torrent/metainfo"
"github.com/anacrolix/torrent/storage"
)
var _ storage.ClientImpl = badStorage{}
func (bs badStorage) OpenTorrent(*metainfo.Info, metainfo.Hash) (storage.TorrentImpl, error) {
- return bs, nil
-}
-
-func (bs badStorage) Close() error {
- return nil
+ return storage.TorrentImpl{
+ Piece: bs.Piece,
+ }, nil
}
func (bs badStorage) Piece(p metainfo.Piece) storage.PieceImpl {
}
func (p badStoragePiece) randomlyTruncatedDataString() string {
- return "hello, world\n"[:rand.Intn(14)]
+ return testutil.GreetingFileContents[:rand.Intn(14)]
}
func (p badStoragePiece) ReadAt(b []byte, off int64) (n int, err error) {