(t *testing.T)
| 125 | } |
| 126 | |
| 127 | func TestGetLastMaxUSN(t *testing.T) { |
| 128 | // set up |
| 129 | db := database.InitTestMemoryDB(t) |
| 130 | database.MustExec(t, "setting up last_max_usn", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemLastMaxUSN, 20001) |
| 131 | |
| 132 | // exec |
| 133 | tx, err := db.Begin() |
| 134 | if err != nil { |
| 135 | t.Fatal(errors.Wrap(err, "beginning a transaction").Error()) |
| 136 | } |
| 137 | |
| 138 | got, err := getLastMaxUSN(tx) |
| 139 | if err != nil { |
| 140 | t.Fatal(errors.Wrap(err, "getting last_max_usn").Error()) |
| 141 | } |
| 142 | |
| 143 | tx.Commit() |
| 144 | |
| 145 | // test |
| 146 | assert.Equal(t, got, 20001, "last_max_usn mismatch") |
| 147 | } |
| 148 | |
| 149 | func TestResolveLabel(t *testing.T) { |
| 150 | testCases := []struct { |
nothing calls this directly
no test coverage detected