MCPcopy Create free account
hub / github.com/akash-network/node / TestSequence

Function TestSequence

util/partialord/partialord_test.go:59–74  ·  view source on GitHub ↗

This test ad-hocly tests combination of multiple sequences, first elements, and an After invocation.

(t *testing.T)

Source from the content-addressed store, hash-verified

57// This test ad-hocly tests combination of multiple sequences, first elements, and an After
58// invocation.
59func TestSequence(t *testing.T) {
60 // This test uses direct ordering before First, and after Last
61 names := []string{"A", "B", "C", "D", "E", "F", "G"}
62 ord := partialord.NewPartialOrdering(names)
63 // Make B A C a sequence
64 ord.Sequence("B", "A", "C")
65 // Make A G E a sub-sequence
66 ord.Sequence("A", "G", "E")
67 // make first elements D B F
68 ord.FirstElements("D", "B", "F")
69 // make C come after E
70 ord.After("C", "G")
71
72 expOrdering := []string{"D", "B", "F", "A", "G", "C", "E"}
73 require.Equal(t, expOrdering, ord.TotalOrdering())
74}

Callers

nothing calls this directly

Calls 5

SequenceMethod · 0.95
FirstElementsMethod · 0.95
AfterMethod · 0.95
TotalOrderingMethod · 0.95
NewPartialOrderingFunction · 0.92

Tested by

no test coverage detected