types_test.go 219 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 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) } }