Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Dec 6, 2023
1 parent e197a20 commit f09ebf1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ func TestEmptyWriteBatch(t *testing.T) {
wb = db.NewWriteBatch()
require.NoError(t, wb.Flush())
wb = db.NewWriteBatch()
// Flush commits inner txn and sets a new one instead.
// Thus we need to save it to check if it was discarded.
txn := wb.txn
require.NoError(t, wb.Flush())
// check that flushed txn was discarded and marked as read.
require.True(t, txn.discarded)
})
})
Expand Down

0 comments on commit f09ebf1

Please sign in to comment.