mirror of
https://github.com/vbatts/merkle.git
synced 2024-11-11 18:08:37 +00:00
18 lines
357 B
Go
18 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)
|
||
|
}
|
||
|
}
|
||
|
}
|