testutil

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNoDupes

func GenerateNoDupes(gen func() unixfs.DirEntry) unixfs.DirEntry

GenerateNoDupes runs the unixfsnode/testutil generator function repeatedly until it produces a DAG with strictly no duplicate CIDs.

func GenerateStrictlyNestedShardedDir

func GenerateStrictlyNestedShardedDir(t *testing.T, linkSys *linking.LinkSystem, randReader io.Reader, targetSize int) unixfs.DirEntry

GenerateStrictlyNestedShardedDir is a wrapper around unixfsnode/testutil.GenerateDirectory that uses dark magic to repeatedly generate a sharded directory until it produces one that is strictly nested. That is, it produces a sharded directory structure with strictly at least one level of sharding with at least two child shards.

Since it is possible to produce a sharded directory that is contained in a single block, this function provides a way to generate a sharded directory for cases where we need to test multi-level sharding.

func ToBlocks

func ToBlocks(t *testing.T, lsys linking.LinkSystem, root cid.Cid, selNode datamodel.Node) []blocks.Block

ToBlocks makes a block array from ordered blocks in a traversal

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL