aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-02 05:11:12 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-02 05:11:12 +0200
commit749665df56b396d8af0b398dcb205b09660c2601 (patch)
treef348ff9d737eeb4cca43698d4281c178ad7dfc75 /meta/torrent_test.go
parent6edbf5b19304f483cf5869d9e8d9ce35ea650a5f (diff)
More examples
Diffstat (limited to 'meta/torrent_test.go')
-rw-r--r--meta/torrent_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/torrent_test.go b/meta/torrent_test.go
new file mode 100644
index 0000000..4965b87
--- /dev/null
+++ b/meta/torrent_test.go
@@ -0,0 +1,20 @@
+package meta
+
+import "testing"
+
+var tors = map[string]string{
+ "bsd": "OpenBSD_5.9_amd64_install59.iso-2016-03-29-0449.torrent",
+ "ogg": "OpenBSD_songs_ogg-2016-03-25-0127.torrent",
+ "deb": "debian-8.5.0-amd64-netinst.iso.torrent",
+}
+
+func TestPieces(t *testing.T) {
+ tor, err := New("../examples/" + tors["ogg"])
+ if err != nil {
+ t.Error(err)
+ }
+ for i := 0; i < tor.Info.NPieces(); i++ {
+ n, off, span := tor.Info.FileOffset(i)
+ t.Log(n, off, span)
+ }
+}