From 92b93449373418da481369078208bd8630d67c41 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 12 Jun 2016 07:10:39 +0200 Subject: Add bool values --- bencode/bencode_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bencode/bencode_test.go') 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) + } +} -- cgit v1.2.3