kaspad/domain/consensus/model/externalapi/blockinfo_clone_test.go
2021-02-17 18:00:16 +02:00

46 lines
640 B
Go

package externalapi
import (
"reflect"
"testing"
)
func initTestBlockInfoStructsForClone() []*BlockInfo {
tests := []*BlockInfo{
{
true,
BlockStatus(0x01),
0,
}, {
true,
BlockStatus(0x02),
0,
}, {
true,
1,
1,
}, {
true,
255,
2,
}, {
true,
0,
3,
},
}
return tests
}
func TestBlockInfo_Clone(t *testing.T) {
blockInfos := initTestBlockInfoStructsForClone()
for i, blockInfo := range blockInfos {
blockInfoClone := blockInfo.Clone()
if !reflect.DeepEqual(blockInfo, blockInfoClone) {
t.Fatalf("Test #%d:[DeepEqual] clone should be equal to the original", i)
}
}
}