From 13b1d4b9a06147cfd1140d42dc6b9ed2ba7a8a90 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 9 Jul 2016 15:17:37 +0200 Subject: int64 --- bencode/bencode_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bencode/bencode_test.go') 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) + } +} -- cgit v1.2.3