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.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/bencode/bencode_test.go b/bencode/bencode_test.go
index 5965afa..329baad 100644
--- a/bencode/bencode_test.go
+++ b/bencode/bencode_test.go
@@ -101,7 +101,7 @@ func TestUnmarshalPartial(t *testing.T) {
}
*/
-func TestBoolUnmarshal(t *testing.T) {
+func TestUnmarshalBool(t *testing.T) {
var b struct{ A bool }
in := `d1:Ai1ee`
err := Unmarshal([]byte(in), &b)
@@ -112,3 +112,15 @@ func TestBoolUnmarshal(t *testing.T) {
t.Error("expected true, got", b.A)
}
}
+
+func TestUnmarshalInt64(t *testing.T) {
+ var b struct{ A int64 }
+ in := `d1:Ai42ee`
+ err := Unmarshal([]byte(in), &b)
+ if err != nil {
+ t.Error(err)
+ }
+ if b.A != 42 {
+ t.Error("expected true, got", b.A)
+ }
+}