Skip to content

Commit

Permalink
bugfix: prevent memory leak from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tauraamui committed Jul 6, 2023
1 parent 9859815 commit 0902a06
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions storage/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ func TestStoreAndLoadMultipleBalloonsSuccess(t *testing.T) {
defer db.Close()

store := storage.New(db)
defer func() {
is.NoErr(store.Close())
}()
defer store.Close()

bigRedBalloon := Balloon{Color: "RED", Size: 695}
smallYellowBalloon := Balloon{Color: "YELLOW", Size: 112}
Expand All @@ -65,9 +63,7 @@ func TestStoreMultipleBalloonsSuccess(t *testing.T) {
defer db.Close()

store := storage.New(db)
defer func() {
is.NoErr(store.Close())
}()
defer store.Close()

bigRedBalloon := Balloon{Color: "RED", Size: 695}
smallYellowBalloon := Balloon{Color: "YELLOW", Size: 112}
Expand All @@ -89,9 +85,7 @@ func TestStoreMultipleBalloonsAndCakesInSuccessionRetainsCorrectRowIDs(t *testin
defer db.Close()

store := storage.New(db)
defer func() {
is.NoErr(store.Close())
}()
defer store.Close()

bigRedBalloon := Balloon{Color: "RED", Size: 695}
disguistingVeganCake := Cake{Type: "INEDIBLE", Calories: -38}
Expand Down

0 comments on commit 0902a06

Please sign in to comment.