aboutsummaryrefslogblamecommitdiffstats
path: root/common/types_test.go
blob: 9f303152c42a3059bf722e49e9f53194f3690d6d (plain) (tree)
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)
    }
}