mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-04 07:48:00 +08:00
Merge pull request #3090 from ipfs/feat/test-cover-blocks-util
test: 100% coverage for blocks/blocksutil
This commit is contained in:
commit
1d0c00eb29
19
blocks/blocksutil/block_generator_test.go
Normal file
19
blocks/blocksutil/block_generator_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user