Skip to content

Assert that paths are equal #27

Description

@TikhonJelvis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions