cursorUsers returns the users fixture rows (fixtures/data.sql) with firstID <= id <= lastID, ordered by id.
(firstID, lastID int)
| 36 | // cursorUsers returns the users fixture rows (fixtures/data.sql) with |
| 37 | // firstID <= id <= lastID, ordered by id. |
| 38 | func cursorUsers(firstID, lastID int) []cursorRow { |
| 39 | all := []cursorRow{ |
| 40 | {1, "Alice"}, {2, "Bob"}, {3, "Charlie"}, {4, "Diana"}, {5, "Eve"}, |
| 41 | {6, "Frank"}, {7, "Grace"}, {8, "Henry"}, {9, "Ivy"}, {10, "Jack"}, |
| 42 | } |
| 43 | var out []cursorRow |
| 44 | for _, u := range all { |
| 45 | if u.id >= firstID && u.id <= lastID { |
| 46 | out = append(out, u) |
| 47 | } |
| 48 | } |
| 49 | return out |
| 50 | } |
| 51 | |
| 52 | func assertCursorRows(t *testing.T, label string, got, want []cursorRow) { |
| 53 | t.Helper() |
no outgoing calls
no test coverage detected