aboutsummaryrefslogtreecommitdiff
path: root/bencode/bencode_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bencode/bencode_test.go')
-rw-r--r--bencode/bencode_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/bencode/bencode_test.go b/bencode/bencode_test.go
index 497cd6f..2a7678f 100644
--- a/bencode/bencode_test.go
+++ b/bencode/bencode_test.go
@@ -20,6 +20,7 @@ func TestMarshal(t *testing.T) {
{Path: []string{"A"}},
{Path: []string{"B"}},
},
+ Private: true,
},
}
out, err := Marshal(v)
@@ -80,3 +81,15 @@ func TestUnmarshal(t *testing.T) {
}
}
}
+
+func TestBoolUnmarshal(t *testing.T) {
+ var b struct{ A bool }
+ in := `d1:Ai1ee`
+ err := Unmarshal([]byte(in), &b)
+ if err != nil {
+ t.Error(err)
+ }
+ if b.A != true {
+ t.Error("expected true, got", b.A)
+ }
+}