From 1011b0952a55c0102cd81ba95d46b8eaeea4bcf5 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 6 Aug 2015 16:13:21 +0200 Subject: Test exported functions --- ber/bool.go | 4 ++-- ber/bool_test.go | 4 ++-- ber/int_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'ber') diff --git a/ber/bool.go b/ber/bool.go index 3bff693..39d2562 100644 --- a/ber/bool.go +++ b/ber/bool.go @@ -1,10 +1,10 @@ package ber -func unmarshalBool(b byte) bool { +func UnmarshalBool(b byte) bool { return b != 0x00 } -func marshalBool(b bool) byte { +func MarshalBool(b bool) byte { if b { return 0xFF } diff --git a/ber/bool_test.go b/ber/bool_test.go index 7471a33..360c3b9 100644 --- a/ber/bool_test.go +++ b/ber/bool_test.go @@ -14,11 +14,11 @@ var boolTestData = []boolTest{ func TestBool(t *testing.T) { for _, test := range boolTestData { - a := marshalBool(test.in) + a := MarshalBool(test.in) if a != test.out { t.Error(test.in, "expected", test.out, "got", a) } - n := unmarshalBool(test.out) + n := UnmarshalBool(test.out) if n != test.in { t.Error(test.out, "expected", test.in, "got", n) } diff --git a/ber/int_test.go b/ber/int_test.go index c7f4ee2..ba1e5b0 100644 --- a/ber/int_test.go +++ b/ber/int_test.go @@ -6,7 +6,7 @@ import ( ) type intTest struct { - in int64 + in int out []byte } @@ -24,11 +24,11 @@ var intTestData = []intTest{ func TestInt(t *testing.T) { for _, test := range intTestData { - a := marshalInt(test.in) + a := MarshalInt(test.in) if !bytes.Equal(a, test.out) { t.Error(test.in, "expected", test.out, "got", a) } - n := unmarshalInt(test.out) + n := UnmarshalInt(test.out) if n != test.in { t.Error(test.out, "expected", test.in, "got", n) } -- cgit v1.2.3