Skip to content

Commit

Permalink
fix(journal): use > rather than >= in rotation condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 4, 2022
1 parent 30ef619 commit bc87e55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/journal/test/JournalTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ appendBSFake bs fj@(FakeJournal bss ix termCount) =
, "limit: " ++ show limit
]) $
if position < limit
then if journalLength >= termLen * termCount
then if journalLength > termLen * termCount
then (FakeJournal (Vector.snoc bss padding) ix (termCount + 1), Left Rotation)
else (FakeJournal (Vector.snoc bss bs) ix termCount, Right ())
else (fj, Left BackPressure)
Expand Down Expand Up @@ -405,11 +405,13 @@ unit_bug6 = assertProgram ""
-- discarded previously it's not part of the padding
-- calculation...


unit_bug7 :: Assertion
unit_bug7 = assertProgram ""
[AppendBS [(32756,'Y')], AppendBS [(32761,'A')], ReadJournal, AppendBS [(1,'J')]]

unit_bug8 :: Assertion
unit_bug8 = assertProgram ""
[AppendBS [(32756,'I')], ReadJournal, AppendBS [(16381,'Q')], AppendBS [(16381,'U')]]

------------------------------------------------------------------------

Expand Down

0 comments on commit bc87e55

Please sign in to comment.