Skip to content

Commit

Permalink
Add test for grep
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Sep 22, 2018
1 parent f1100df commit b106ae2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ renderPageToFile :: FilePath -> FilePath -> IO ()
renderPageToFile mdfile opfile = do
withBinaryFile opfile WriteMode (\handle -> renderPage mdfile handle)

-- For adding new command, you need to add:
-- A new ".md" file for that command
-- A new ".golden" file for the expected output

commandTest :: String -> TestTree
commandTest str = goldenVsFile (str <> " test") (golden str) (output str) (renderPageToFile (md str) (output str))
where
Expand All @@ -26,6 +30,8 @@ gtests :: TestTree
gtests = testGroup "(render test)"
[
commandTest "ls"
, commandTest "ps"
, commandTest "grep"
]

main :: IO ()
Expand Down

0 comments on commit b106ae2

Please sign in to comment.