aboutsummaryrefslogtreecommitdiff
path: root/bencode/bencode_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-09 15:17:37 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-09 15:17:37 +0200
commit13b1d4b9a06147cfd1140d42dc6b9ed2ba7a8a90 (patch)
treecf134c619fe839764563717d3910be6cdb06c602 /bencode/bencode_test.go
parentdff1ff318d9ccb7e1c7aac6f9f3f86b139f86b49 (diff)
int64
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)
+ }
+}