1
0
Fork 0
mirror of https://github.com/vbatts/merkle.git synced 2024-12-11 14:38:03 +00:00
merkle/block_test.go

17 lines
357 B
Go

package merkle
import "testing"
func TestBlockSize(t *testing.T) {
var testSet = [][2]int{
{1024 * 1024, 16384},
{1023 * 1023, 0}, // Not a evenly divisible
{1023, 1023}, // less than the max
}
for _, item := range testSet {
got := DetermineBlockSize(item[0])
if got != item[1] {
t.Errorf("expected %d, got %d", item[1], got)
}
}
}