MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestMergeTwoHash

Function TestMergeTwoHash

merkle/merkletrie_test.go:14–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestMergeTwoHash(t *testing.T) {
15 Convey("Concatenate of two hash should be equal to the result", t, func() {
16 h0 := &hash.Hash{}
17 rand.Read(h0[:])
18 h1 := &hash.Hash{}
19 rand.Read(h1[:])
20 wanted := mergeHash(h0, h1)
21
22 So(bytes.Compare(MergeTwoHash(h0, h1).CloneBytes(), wanted[:]), ShouldEqual, 0)
23 })
24}
25
26func TestNewMerkle(t *testing.T) {
27 tests := [][]*hash.Hash{

Callers

nothing calls this directly

Calls 4

mergeHashFunction · 0.85
MergeTwoHashFunction · 0.85
CloneBytesMethod · 0.80
ReadMethod · 0.65

Tested by

no test coverage detected