mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 05:20:11 +00:00
46 lines
640 B
Go
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)
|
|
}
|
|
}
|
|
}
|