diff options
Diffstat (limited to 'internal/store/sqlite_test.go')
| -rw-r--r-- | internal/store/sqlite_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/store/sqlite_test.go b/internal/store/sqlite_test.go index fc8a3b7..9aef09d 100644 --- a/internal/store/sqlite_test.go +++ b/internal/store/sqlite_test.go @@ -125,7 +125,7 @@ func setupTestStoreWithMeals(t *testing.T) *Store { // TestDeleteTask verifies that DeleteTask removes a task from the cache func TestDeleteTask(t *testing.T) { store := setupTestStoreWithTasks(t) - defer store.Close() + defer func() { _ = store.Close() }() // Save some tasks tasks := []models.Task{ @@ -213,7 +213,7 @@ func TestDeleteTask(t *testing.T) { // TestDeleteTask_NonExistent verifies that deleting a non-existent task doesn't error func TestDeleteTask_NonExistent(t *testing.T) { store := setupTestStoreWithTasks(t) - defer store.Close() + defer func() { _ = store.Close() }() // Delete a task that doesn't exist - should not error err := store.DeleteTask("nonexistent") @@ -225,7 +225,7 @@ func TestDeleteTask_NonExistent(t *testing.T) { // TestDeleteCard verifies that DeleteCard removes a card from the cache func TestDeleteCard(t *testing.T) { store := setupTestStoreWithCards(t) - defer store.Close() + defer func() { _ = store.Close() }() // First create a board _, err := store.db.Exec(`INSERT INTO boards (id, name) VALUES (?, ?)`, "board1", "Test Board") @@ -292,7 +292,7 @@ func TestDeleteCard(t *testing.T) { // TestDeleteCard_NonExistent verifies that deleting a non-existent card doesn't error func TestDeleteCard_NonExistent(t *testing.T) { store := setupTestStoreWithCards(t) - defer store.Close() + defer func() { _ = store.Close() }() // Delete a card that doesn't exist - should not error err := store.DeleteCard("nonexistent") @@ -306,7 +306,7 @@ func TestDeleteCard_NonExistent(t *testing.T) { // where pointers in boardMap became stale when the boards slice grew. func TestSaveAndGetBoards_MultipleBoards(t *testing.T) { store := setupTestStoreWithCards(t) - defer store.Close() + defer func() { _ = store.Close() }() // Create multiple boards with varying numbers of cards // Use enough boards to trigger slice reallocation @@ -411,7 +411,7 @@ func TestSaveAndGetBoards_MultipleBoards(t *testing.T) { // to ensure slice reallocation is thoroughly tested func TestSaveAndGetBoards_ManyBoards(t *testing.T) { store := setupTestStoreWithCards(t) - defer store.Close() + defer func() { _ = store.Close() }() // Create 20 boards with 5 cards each = 100 cards total numBoards := 20 @@ -466,7 +466,7 @@ func TestSaveAndGetBoards_ManyBoards(t *testing.T) { func TestGetTasksByDateRange(t *testing.T) { store := setupTestStoreWithTasks(t) - defer store.Close() + defer func() { _ = store.Close() }() now := time.Now() tomorrow := now.Add(24 * time.Hour) @@ -498,7 +498,7 @@ func TestGetTasksByDateRange(t *testing.T) { func TestGetMealsByDateRange(t *testing.T) { store := setupTestStoreWithMeals(t) - defer store.Close() + defer func() { _ = store.Close() }() now := time.Now() tomorrow := now.Add(24 * time.Hour) @@ -530,7 +530,7 @@ func TestGetMealsByDateRange(t *testing.T) { func TestGetCardsByDateRange(t *testing.T) { store := setupTestStoreWithCards(t) - defer store.Close() + defer func() { _ = store.Close() }() now := time.Now() tomorrow := now.Add(24 * time.Hour) @@ -603,7 +603,7 @@ func setupTestStoreWithBugs(t *testing.T) *Store { func TestBugResolution(t *testing.T) { store := setupTestStoreWithBugs(t) - defer store.Close() + defer func() { _ = store.Close() }() // Save some bugs if err := store.SaveBug("Bug 1"); err != nil { @@ -681,7 +681,7 @@ func TestBugResolution(t *testing.T) { func TestResolveBug_NonExistent(t *testing.T) { store := setupTestStoreWithBugs(t) - defer store.Close() + defer func() { _ = store.Close() }() // Resolving a non-existent bug should not error (no rows affected is fine) err := store.ResolveBug(999) |
