refactor piece validator tests

This commit is contained in:
Marcin Czenko 2025-03-25 14:58:52 +01:00
parent 86166196de
commit ea3cfe0b04
No known key found for this signature in database
GPG Key ID: 33DEA0C8E30937C0

View File

@ -10,7 +10,7 @@ import pkg/codex/manifest
import pkg/codex/bittorrent/manifest
import pkg/codex/bittorrent/piecevalidator
suite "Torrent PieceValidator":
template createExampleTorrentData() {.dirty.} =
const numOfPieces = 10
const pieceLength = 65536
const contentLength = pieceLength * numOfPieces
@ -34,6 +34,9 @@ suite "Torrent PieceValidator":
mimetype = "application/octet-stream".some,
)
suite "Torrent PieceValidator":
createExampleTorrentData()
var pieceValidator: TorrentPieceValidator
setup: