HUnit icon indicating copy to clipboard operation
HUnit copied to clipboard

Assert that paths are equal

Open TikhonJelvis opened this issue 3 years ago • 0 comments

I recently found myself writing a function to check that filepaths are equal:

assertEqualPath got expected = do
  got'      <- canonicalizePath got
  expected' <- canonicalizePath expected
  assertBool (printf "expected: %s\n but got: %s" expected' got') $
    equalFilePath got' expected'

This depends on both directory and filepath, but both of those are GHC boot packages so that seems pretty reasonable.

Would it make sense to add this to HUnit? Happy to put together a PR if it would.

TikhonJelvis avatar Aug 25 '20 19:08 TikhonJelvis