This test ad-hocly tests combination of multiple sequences, first elements, and an After invocation.
(t *testing.T)
| 57 | // This test ad-hocly tests combination of multiple sequences, first elements, and an After |
| 58 | // invocation. |
| 59 | func 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 | } |
nothing calls this directly
no test coverage detected