slices.SortFunc(running, func(a, b NodeKey) int {
return a.index - b.index
})
+
require.Equal(t, []NodeKey{{0, 0}, {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 6}, {0, 7}}, running)
require.Eventually(t, func() bool {
cause string
}{
{
- name: "receipt points to different text",
+ name: "refuses when receipt points to different text",
id: 0,
cause: "does not match",
},
{
- name: "receipt skips a log position",
+ name: "refuses when receipt skips a log position",
id: 2,
cause: "beyond the log",
},
{
- name: "receipt has a negative position",
+ name: "refuses when receipt has a negative position",
id: -1,
cause: "read queued message",
},
}
+
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
_, err := memory.AppendOnce("user", "Other text.", &tc.id, func(int) error {