lotus/lib/padreader/padreader_test.go

20 lines
461 B
Go
Raw Normal View History

2019-11-06 23:09:48 +00:00
package padreader
import (
"testing"
"gotest.tools/assert"
2019-11-06 23:09:48 +00:00
)
func TestComputePaddedSize(t *testing.T) {
assert.Equal(t, uint64(1040384), PaddedSize(1000000))
2019-11-08 19:55:03 +00:00
2019-11-06 23:09:48 +00:00
assert.Equal(t, uint64(1016), PaddedSize(548))
2019-11-08 19:55:03 +00:00
assert.Equal(t, uint64(1016), PaddedSize(1015))
assert.Equal(t, uint64(1016), PaddedSize(1016))
assert.Equal(t, uint64(2032), PaddedSize(1017))
assert.Equal(t, uint64(2032), PaddedSize(1024))
2019-11-06 23:09:48 +00:00
assert.Equal(t, uint64(4064), PaddedSize(2048))
}