package ber import "testing" func testBool(t *testing.T, v bool, b byte) { a := marshalBool(v) if (a & 1) != (b & 1) { t.Error("BER", v, "expected", b, "got", a) } n := unmarshalBool(b) if n != v { t.Error("UnBER", b, "expected", v, "got", n) } } func TestBool(t *testing.T) { testBool(t, true, 0xFF) testBool(t, true, 0x01) testBool(t, false, 0x00) }