(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func TestGetLastSyncAt(t *testing.T) { |
| 106 | // set up |
| 107 | db := database.InitTestMemoryDB(t) |
| 108 | database.MustExec(t, "setting up last_sync_at", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemLastSyncAt, 1541108743) |
| 109 | |
| 110 | // exec |
| 111 | tx, err := db.Begin() |
| 112 | if err != nil { |
| 113 | t.Fatal(errors.Wrap(err, "beginning a transaction").Error()) |
| 114 | } |
| 115 | |
| 116 | got, err := getLastSyncAt(tx) |
| 117 | if err != nil { |
| 118 | t.Fatal(errors.Wrap(err, "getting last_sync_at").Error()) |
| 119 | } |
| 120 | |
| 121 | tx.Commit() |
| 122 | |
| 123 | // test |
| 124 | assert.Equal(t, got, 1541108743, "last_sync_at mismatch") |
| 125 | } |
| 126 | |
| 127 | func TestGetLastMaxUSN(t *testing.T) { |
| 128 | // set up |
nothing calls this directly
no test coverage detected