aboutsummaryrefslogtreecommitdiff
path: root/ber/bool_test.go
diff options
context:
space:
mode:
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)
}