1
0
Fork 0
mirror of https://github.com/vbatts/merkle.git synced 2024-11-11 18:08:37 +00:00
merkle/block_test.go

18 lines
357 B
Go
Raw Normal View History

2015-03-18 18:31:16 +00:00
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)
}
}
}