package ber import "testing" type boolTest struct { in bool out byte } var boolTestData = []boolTest{ {true, 0xFF}, {false, 0x00}, } func TestBool(t *testing.T) { for _, test := range boolTestData { a := MarshalBool(test.in) if a != test.out { t.Error(test.in, "expected", test.out, "got", a) } n := UnmarshalBool(test.out) if n != test.in { t.Error(test.out, "expected", test.in, "got", n) } } }