2016-08-26 18:29:05 +08:00
|
|
|
package metainfo
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2018-11-02 20:12:01 +08:00
|
|
|
"github.com/stretchr/testify/assert"
|
2019-08-21 18:58:40 +08:00
|
|
|
|
|
|
|
"github.com/anacrolix/torrent/bencode"
|
2016-08-26 18:29:05 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMarshalInfo(t *testing.T) {
|
|
|
|
var info Info
|
|
|
|
b, err := bencode.Marshal(info)
|
|
|
|
assert.NoError(t, err)
|
2018-11-27 08:05:32 +08:00
|
|
|
assert.EqualValues(t, "d4:name0:12:piece lengthi0e6:pieces0:e", string(b))
|
2016-08-26 18:29:05 +08:00
|
|
|
}
|