From 2864729d325aa13bd8591536185bf09bc0505bfa Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 26 Jun 2015 20:12:33 +0200 Subject: Obj marshaler --- ber/obj_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ber/obj_test.go') diff --git a/ber/obj_test.go b/ber/obj_test.go index e874d17..d8299bb 100644 --- a/ber/obj_test.go +++ b/ber/obj_test.go @@ -17,3 +17,17 @@ func TestBase128(t *testing.T) { testBase128(t, 113549, []byte{0x86, 0xF7, 0x0D}) testBase128(t, 49152, []byte{0x83, 0x80, 0x00}) } + +func testObj(t *testing.T, o []int, e []byte) { + a := marshalObj(o) + if !bytes.Equal(a, e) { + t.Error("Obj", o, "expexted", e, "got", a) + } +} + +func TestObj(t *testing.T) { + testObj(t, []int{1, 3, 12, 0, 218}, + []byte{0x2B, 0x0C, 0x00, 0x81, 0x5A}) + testObj(t, []int{1, 3, 12, 0, 285, 200}, + []byte{0x2B, 0x0C, 0x00, 0x82, 0x1D, 0x81, 0x48}) +} -- cgit v1.2.3