aboutsummaryrefslogtreecommitdiff
path: root/ber/bool_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-25 20:41:38 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-25 20:41:38 +0200
commit511cf41a779929b5c81b7429c37dc11bd9544182 (patch)
tree6ab421d4b7ec868c48b40da57e3de542831767dd /ber/bool_test.go
parent0559b7d4eab07cacf0f005e8e756c1d04470e0c7 (diff)
Rewrite from scratch
Diffstat (limited to 'ber/bool_test.go')
-rw-r--r--ber/bool_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/ber/bool_test.go b/ber/bool_test.go
index 360c3b9..1eae7e6 100644
--- a/ber/bool_test.go
+++ b/ber/bool_test.go
@@ -1,6 +1,9 @@
package ber
-import "testing"
+import (
+ "bytes"
+ "testing"
+)
type boolTest struct {
in bool
@@ -14,11 +17,14 @@ var boolTestData = []boolTest{
func TestBool(t *testing.T) {
for _, test := range boolTestData {
- a := MarshalBool(test.in)
+ buf := &bytes.Buffer{}
+ MarshalBool(buf, test.in)
+ a, _ := buf.ReadByte()
if a != test.out {
t.Error(test.in, "expected", test.out, "got", a)
}
- n := UnmarshalBool(test.out)
+ buf.WriteByte(test.out)
+ n := UnmarshalBool(buf)
if n != test.in {
t.Error(test.out, "expected", test.in, "got", n)
}