diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/types_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/types_test.go b/common/types_test.go new file mode 100644 index 000000000..9f303152c --- /dev/null +++ b/common/types_test.go @@ -0,0 +1,15 @@ +package common + +import "testing" + +func TestBytesConversion(t *testing.T) { + bytes := []byte{5} + hash := BytesToHash(bytes) + + var exp Hash + exp[31] = 5 + + if hash != exp { + t.Errorf("expected %x got %x", exp, hash) + } +} |