aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'meta/torrent_test.go')
-rw-r--r--meta/torrent_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/torrent_test.go b/meta/torrent_test.go
index 3dd8595..d8706e0 100644
--- a/meta/torrent_test.go
+++ b/meta/torrent_test.go
@@ -9,6 +9,16 @@ var tors = map[string]string{
"mul": "multi.torrent",
}
+func TestHash(t *testing.T) {
+ tor, err := New("../examples/" + tors["bsd"])
+ if err != nil {
+ t.Error(err)
+ }
+ if tor.Info.Hash() != [20]byte{0xe8, 0x40, 0x03, 0x8d, 0xea, 0x19, 0x98, 0xc3, 0x96, 0x14, 0xdc, 0xd2, 0x85, 0x94, 0x50, 0x1d, 0xf0, 0x2b, 0xd3, 0x2d} {
+ t.Errorf("wrong info hash %x", tor.Info.Hash())
+ }
+}
+
func TestPieces(t *testing.T) {
tor, err := New("../examples/" + tors["mul"])
if err != nil {