Versions in this module Expand all Collapse all v0 v0.16.2 Dec 14, 2023 v0.16.1 Dec 14, 2023 Changes in this version + func AssertChannelEmpty(t testing.TB, channel interface{}, errorMessage string) + func AssertContainsBlock(t testing.TB, blks []blocks.Block, block blocks.Block) + func AssertContainsPeer(t testing.TB, peers []peer.ID, p peer.ID) + func AssertDoesReceive(ctx context.Context, t testing.TB, channel interface{}, errorMessage string) + func AssertDoesReceiveFirst(t testing.TB, channel interface{}, errorMessage string, ...) + func AssertReceive(ctx context.Context, t testing.TB, channel interface{}, out interface{}, ...) + func AssertReceiveFirst(t testing.TB, channel interface{}, out interface{}, errorMessage string, ...) + func AssertSends(ctx context.Context, t testing.TB, channel interface{}, in interface{}, ...) + func AttributeValueInTraceSpan(t *testing.T, stub tracetest.SpanStub, attributeName string) attribute.Value + func CollectErrors(ctx context.Context, t *testing.T, errChan <-chan error) []error + func CollectResponses(ctx context.Context, t testing.TB, ...) []graphsync.ResponseProgress + func ContainsBlock(blks []blocks.Block, block blocks.Block) bool + func ContainsPeer(peers []peer.ID, p peer.ID) bool + func EventInTraceSpan(t *testing.T, stub tracetest.SpanStub, eventName string) trace.Event + func GenerateBlocksOfSize(n int, size int64) []blocks.Block + func GenerateCids(n int) []cid.Cid + func GeneratePeers(n int) []peer.ID + func IndexOf(blks []blocks.Block, c cid.Cid) int + func NewFakeBlockData() graphsync.BlockData + func NewInvalidSelectorSpec() ipld.Node + func NewTestLink() ipld.Link + func NewTestStore(blocksWritten map[ipld.Link][]byte) ipld.LinkSystem + func NewUnparsableSelectorSpec() ipld.Node + func RandomBytes(n int64) []byte + func ReadNResponses(ctx context.Context, t testing.TB, ...) []graphsync.ResponseProgress + func RefuteContainsBlock(t testing.TB, blks []blocks.Block, block blocks.Block) + func RefuteContainsPeer(t testing.TB, peers []peer.ID, p peer.ID) + func RepeatTraceStrings(tmpl string, count int) []string + func SetupTracing(ctx context.Context) (context.Context, func(t *testing.T) *Collector) + func VerifyEmptyErrors(ctx context.Context, t testing.TB, errChan <-chan error) + func VerifyEmptyResponse(ctx context.Context, t testing.TB, ...) + func VerifyHasErrors(ctx context.Context, t testing.TB, errChan <-chan error) + func VerifySingleTerminalError(ctx context.Context, t testing.TB, errChan <-chan error) + type Collector struct + Spans tracetest.SpanStubs + func (c *Collector) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error + func (c *Collector) Shutdown(ctx context.Context) error + func (c Collector) FindParentSpans() tracetest.SpanStubs + func (c Collector) FindSpanByTraceString(trace string) *tracetest.SpanStub + func (c Collector) FindSpans(name string) tracetest.SpanStubs + func (c Collector) FindSpansWithParent(stub tracetest.SpanStub) tracetest.SpanStubs + func (c Collector) SingleExceptionEvent(t *testing.T, trace string, typeRe string, messageRe string, errorCode bool) + func (c Collector) TracesToStrings() []string + type DispatchedEvent struct + Event notifications.Event + Topic notifications.Topic + type ExceptionEvent struct + Message string + Type string + func EventAsException(t *testing.T, evt trace.Event) ExceptionEvent + type MockPublisher struct + func NewMockPublisher() *MockPublisher + func (mp *MockPublisher) AddSubscriber(subscriber notifications.Subscriber) + func (mp *MockPublisher) PublishEvents(topic notifications.Topic, events []notifications.Event) + type TestBlockChain struct + GenisisLink ipld.Link + GenisisNode ipld.Node + MiddleLinks []ipld.Link + MiddleNodes []ipld.Node + TipLink ipld.Link + TipNode ipld.Node + func SetupBlockChain(ctx context.Context, t testing.TB, lsys ipld.LinkSystem, size uint64, ...) *TestBlockChain + func (tbc *TestBlockChain) AllBlocks() []blocks.Block + func (tbc *TestBlockChain) Blocks(from int, to int) []blocks.Block + func (tbc *TestBlockChain) Chooser(ipld.Link, ipld.LinkContext) (ipld.NodePrototype, error) + func (tbc *TestBlockChain) LinkTipIndex(fromTip int) ipld.Link + func (tbc *TestBlockChain) NodeTipIndex(fromTip int) ipld.Node + func (tbc *TestBlockChain) PathTipIndex(fromTip int) ipld.Path + func (tbc *TestBlockChain) RemainderBlocks(from int) []blocks.Block + func (tbc *TestBlockChain) Selector() ipld.Node + func (tbc *TestBlockChain) VerifyRemainder(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyRemainderSync(responses []graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyRemainderWithTypes(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int) + func (tbc *TestBlockChain) VerifyResponseRange(ctx context.Context, responseChan <-chan graphsync.ResponseProgress, from int, ...) + func (tbc *TestBlockChain) VerifyResponseRangeSync(responses []graphsync.ResponseProgress, from int, to int) + func (tbc *TestBlockChain) VerifyWholeChain(ctx context.Context, responseChan <-chan graphsync.ResponseProgress) + func (tbc *TestBlockChain) VerifyWholeChainSync(responses []graphsync.ResponseProgress) + func (tbc *TestBlockChain) VerifyWholeChainWithTypes(ctx context.Context, responseChan <-chan graphsync.ResponseProgress) + type TestConnManager struct + func NewTestConnManager() *TestConnManager + func (tcm *TestConnManager) AssertProtected(t testing.TB, p peer.ID) + func (tcm *TestConnManager) AssertProtectedWithTags(t testing.TB, p peer.ID, tags ...string) + func (tcm *TestConnManager) Protect(p peer.ID, tag string) + func (tcm *TestConnManager) RefuteProtected(t testing.TB, p peer.ID) + func (tcm *TestConnManager) RefuteProtectedWithTags(t testing.TB, p peer.ID, tags ...string) + func (tcm *TestConnManager) Unprotect(p peer.ID, tag string) bool + type TestIPLDTree struct + LeafAlpha ipld.Node + LeafAlphaBlock blocks.Block + LeafAlphaLnk ipld.Link + LeafBeta ipld.Node + LeafBetaBlock blocks.Block + LeafBetaLnk ipld.Link + MiddleListBlock blocks.Block + MiddleListNode ipld.Node + MiddleListNodeLnk ipld.Link + MiddleMapBlock blocks.Block + MiddleMapNode ipld.Node + MiddleMapNodeLnk ipld.Link + RootBlock blocks.Block + RootNode ipld.Node + RootNodeLnk ipld.Link + Storage map[ipld.Link][]byte + func NewTestIPLDTree() TestIPLDTree + type TestIdentityDAG struct + AllLinks []ipld.Link + AllLinksNoIdent []ipld.Link + RootLink ipld.Link + func SetupIdentityDAG(ctx context.Context, t testing.TB, lsys ipld.LinkSystem) *TestIdentityDAG + func (tid *TestIdentityDAG) AllBlocks() []blocks.Block + func (tid *TestIdentityDAG) VerifyWholeDAG(ctx context.Context, responseChan <-chan graphsync.ResponseProgress) + type TestSubscriber struct + func NewTestSubscriber(bufferSize int) *TestSubscriber + func (ts *TestSubscriber) ExpectCloses(ctx context.Context, t *testing.T, topics []notifications.Topic) + func (ts *TestSubscriber) ExpectClosesAnyOrder(ctx context.Context, t *testing.T, topics []notifications.Topic) + func (ts *TestSubscriber) ExpectEvents(ctx context.Context, t *testing.T, events []DispatchedEvent) + func (ts *TestSubscriber) ExpectEventsAllTopics(ctx context.Context, t *testing.T, events []notifications.Event) + func (ts *TestSubscriber) ExpectNCloses(ctx context.Context, t *testing.T, n int) + func (ts *TestSubscriber) NoEventsReceived(t *testing.T) + func (ts *TestSubscriber) OnClose(topic notifications.Topic) + func (ts *TestSubscriber) OnNext(topic notifications.Topic, ev notifications.Event)