mirror of
https://github.com/vbatts/merkle.git
synced 2024-12-02 19:15:39 +00:00
17 lines
357 B
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)
|
|
}
|
|
}
|
|
}
|