2016-08-26 18:29:05 +08:00
|
|
|
package metainfo
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/anacrolix/torrent/bencode"
|
2018-11-02 20:12:01 +08:00
|
|
|
"github.com/stretchr/testify/assert"
|
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)
|
|
|
|
assert.EqualValues(t, "d4:name0:12:piece lengthi0e6:pieceslee", string(b))
|
|
|
|
}
|