Skip to content

Commit

Permalink
fixed test case for the panic case
Browse files Browse the repository at this point in the history
  • Loading branch information
sio4 committed Nov 19, 2022
1 parent 3eb2621 commit 8c6c9e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ func Test_Connection_Transaction(t *testing.T) {
})

t.Run("Panic", func(t *testing.T) {
err = c.Transaction(func(c *Connection) error {
panic("inner function panic")
r.PanicsWithValue("inner function panic", func() {
c.Transaction(func(c *Connection) error {
panic("inner function panic")
})
})
r.ErrorContains(err, "panic")
r.ErrorContains(err, "rolled back")
})
}

0 comments on commit 8c6c9e7

Please sign in to comment.