Documentation ¶
Index ¶
- func AnyType() schema.Type
- func BindFailure(t testing.TB, n ipld.Node) fdm.FailureModel
- func GetFreePort(t *testing.T) int
- func Must[T any](val T, err error) func(*testing.T) T
- func Must2[T, U any](val1 T, val2 U, err error) func(*testing.T) (T, U)
- func RandomBytes(t *testing.T, size int) (multihash.Multihash, []byte)
- func RandomCAR(t *testing.T, size int) (ipld.Link, multihash.Multihash, multihash.Multihash, []byte)
- func RandomCID(t *testing.T) ipld.Link
- func RandomLocalURL(t *testing.T) url.URL
- func RandomPrincipal(t *testing.T) ucan.Principal
- func RandomSigner(t *testing.T) principal.Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFailure ¶
func BindFailure(t testing.TB, n ipld.Node) fdm.FailureModel
BindFailure binds the IPLD node to a FailureModel if possible. This works around IPLD requiring data to match the schema exactly
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func Must ¶
Must takes return values from a function and returns the non-error one. If the error value is non-nil then it fails the test
func Must2 ¶
Must2 takes return values from a 3 return function and returns the non-error ones. If the error value is non-nil then it fails the test.
func RandomCAR ¶
func RandomCAR(t *testing.T, size int) (ipld.Link, multihash.Multihash, multihash.Multihash, []byte)
RandomCAR creates a CAR with a single block of random bytes of the specified size. It returns the link of the root block, the hash of the root block, the hash of the CAR itself and the bytes of the CAR.
func RandomLocalURL ¶
RandomLocalURL finds a free port and will not generate another URL with the same port until test cleanup, even if no service is bound to it.
Types ¶
This section is empty.