From 0fa7859b94ddb0a35a6fbdb2c29139b0baaa2bfa Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 17 Mar 2015 13:24:12 +0100 Subject: Fixed VM & Tests w/ conversion --- common/types_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 common/types_test.go (limited to 'common') 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) + } +} -- cgit