aboutsummaryrefslogtreecommitdiff
path: root/ber/bits_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/bits_test.go')
-rw-r--r--ber/bits_test.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/ber/bits_test.go b/ber/bits_test.go
index ebc8796..c20b3db 100644
--- a/ber/bits_test.go
+++ b/ber/bits_test.go
@@ -1,6 +1,9 @@
package ber
-import "testing"
+import (
+ "bytes"
+ "testing"
+)
type bitTest struct {
bytes []byte
@@ -39,9 +42,13 @@ func bitsEqual(a, b Bits) bool {
func TestBits(t *testing.T) {
for _, test := range bitTestData {
- bits := UnmarshalBitString(test.bytes)
- if !bitsEqual(bits, test.bits) {
- t.Error(test.bytes, "expexted", test.bits, "got", bits)
+ bi := UnmarshalBitString(test.bytes)
+ if !bitsEqual(bi, test.bits) {
+ t.Error(test.bytes, "expexted", test.bits, "got", bi)
+ }
+ by := MarshalBitString(test.bits)
+ if !bytes.Equal(by, test.bytes) {
+ t.Error(test.bits, "expexted", test.bytes, "got", by)
}
}
}