now marshaller respects options like 'omitempty'
This commit is contained in:
parent
058076e94f
commit
e27d7cfab2
3 changed files with 71 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
package torrent
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/vbatts/go-bt/bencode"
|
||||
"testing"
|
||||
)
|
||||
|
@ -19,6 +20,10 @@ func TestFileMarshal(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if bytes.Contains(buf, []byte("omitempty")) || bytes.Contains(buf, []byte("created by")) {
|
||||
t.Errorf("should not have the string 'omitempty' or 'created by' in %q", buf)
|
||||
}
|
||||
|
||||
f2 := File{}
|
||||
err = bencode.Unmarshal(buf, &f2)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue