aboutsummaryrefslogtreecommitdiff
path: root/bencode/bencode_test.go
blob: 01e0446bf3fec0daee17b5cdad2ff625bf0b9e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package bencode

import (
	"testing"

	"dim13.org/btr/torrent"
)

func TestMarshal(t *testing.T) {
	v := torrent.Torrent{
		Announce:     "test",
		AnnounceList: []string{"test1", "test2", "test3"},
		CreationDate: 123,
		Info: torrent.Info{
			Length: 1000,
			Files: []torrent.File{
				{Path: "A"},
				{Path: "B"},
			},
		},
	}
	out, err := Marshal(v)
	if err != nil {
		t.Error(err)
	}
	t.Logf("%q\n", string(out))
}