Skip to content

Commit

Permalink
feat(journal): add new failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 8, 2022
1 parent 37408a3 commit 2b7f953
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/journal/test/JournalTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,17 @@ validProgram = go True
testOptions :: Options
testOptions = defaultOptions

forAllCommands :: ([Command] -> Property) -> Property
forAllCommands k =
forAllShrinkShow (genCommands m) (shrinkCommands m) prettyCommands k
where
m :: Model
m = startJournalFake

prop_journal :: Property
prop_journal =
let m = startJournalFake in
forAllShrinkShow (genCommands m) (shrinkCommands m) prettyCommands $ \cmds -> monadicIO $ do
forAllCommands $ \cmds -> monadicIO $ do
-- run (putStrLn ("Generated commands: " ++ show cmds))
tmp <- run (canonicalizePath =<< getTemporaryDirectory)
(fp, h) <- run (openTempFile tmp "JournalTest")
Expand Down Expand Up @@ -429,6 +436,18 @@ unit_bug10 = assertProgram ""
, AppendBS [(1,'X')], ReadJournal
]

unit_bug11 :: Assertion
unit_bug11 = assertProgram ""
[ AppendBS [(32754,'A')], ReadJournal
, AppendBS [(32754,'B')], ReadJournal
, AppendBS [(32754,'C')], ReadJournal
, AppendBS [(32754,'D')], ReadJournal
, AppendBS [(32754,'E')], ReadJournal
, AppendBS [(32754,'F')], ReadJournal
, AppendBS [(32754,'G')], ReadJournal
, AppendBS [(32754,'H')], ReadJournal
]

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

assertProgram :: String -> [Command] -> Assertion
Expand Down

0 comments on commit 2b7f953

Please sign in to comment.