Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Galazyn <[email protected]>
  • Loading branch information
palas and carbolymer authored Mar 20, 2024
1 parent a7c3a1d commit 96c1370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hedgehog/Extras/Test/File.hs
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ appendFileTimeDelta filePath offsetTime = GHC.withFrozenCallStack $ do
assertDirectoryExists :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
assertDirectoryExists dir = GHC.withFrozenCallStack $ do
exists <- H.evalIO $ IO.doesDirectoryExist dir
unless exists $ H.failWithCustom GHC.callStack Nothing (dir <> " has not been successfully created.")
unless exists $ H.failWithCustom GHC.callStack Nothing ("Directory " <> dir <> " does exist on the file system.")

-- | Asserts that the given directory is missing.
assertDirectoryMissing :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m ()
assertDirectoryMissing dir = GHC.withFrozenCallStack $ do
exists <- H.evalIO $ IO.doesDirectoryExist dir
when exists $ H.failWithCustom GHC.callStack Nothing (dir <> " should not have been created.")
when exists $ H.failWithCustom GHC.callStack Nothing ("Directory " <> dir <> " does not exist on the file system.")

0 comments on commit 96c1370

Please sign in to comment.