From 0fe086993b01f7d53c8b226bd1eb5665c1d0c18f Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 17 Jul 2016 03:05:33 +0200 Subject: Replace InfoHash with Raw --- meta/torrent_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'meta/torrent_test.go') 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 { -- cgit v1.2.3