Merge pull request #3090 from ipfs/feat/test-cover-blocks-util

test: 100% coverage for blocks/blocksutil
This commit is contained in:
Jeromy Johnson 2016-08-16 09:22:07 -07:00 committed by GitHub
commit 1d0c00eb29

View File

@ -0,0 +1,19 @@
package blocksutil
import "testing"
func TestBlocksAreDifferent(t *testing.T) {
gen := NewBlockGenerator()
blocks := gen.Blocks(100)
for i, block1 := range blocks {
for j, block2 := range blocks {
if i != j {
if block1.String() == block2.String() {
t.Error("Found duplicate blocks")
}
}
}
}
}