(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestHashBytes(t *testing.T) { |
| 9 | bits := [32]byte{ |
| 10 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 11 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 12 | } |
| 13 | hash := NewHash(bits) |
| 14 | |
| 15 | gotBits := hash.Byte32() |
| 16 | if !bytes.Equal(bits[:], gotBits[:]) { |
| 17 | t.Errorf("NewHash(%x).Byte32 = %x", bits, gotBits) |
| 18 | } |
| 19 | |
| 20 | hash = HashFromBytes(bits[:]) |
| 21 | gotBits = hash.Byte32() |
| 22 | if !bytes.Equal(bits[:], gotBits[:]) { |
| 23 | t.Errorf("HashFromBytes(%x).Byte32 = %x", bits, gotBits) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestHashMarshalText(t *testing.T) { |
| 28 | hash := NewHash([32]byte{1}) |
nothing calls this directly
no test coverage detected