fix quickcheck test on windows
authorJoey Hess <joeyh@joeyh.name>
Tue, 22 Mar 2022 17:53:55 +0000 (13:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 22 Mar 2022 17:53:55 +0000 (13:53 -0400)
prop_relPathDirToFileAbs_basics (TestableFilePath ":/") failed on
windows. The colon was filtered out after trying to make
the path relative, which only removed leading path separators.
So, ":/" changed to "/" which is not relative. Filtering out the colon
before hand avoids this problem.

Sponsored-by: Luke Shumaker on Patreon
Utility/Path/Tests.hs
doc/bugs/test_prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn

index b35e8867d682e17cf3b220254e5cdd6d6f155f45..88f94b3faa0e5632ba20451b50b582b774688dfa 100644 (file)
@@ -49,7 +49,8 @@ prop_relPathDirToFileAbs_basics pt = and
        p = pathSeparator `B.cons` relf
        -- Make the input a relative path. On windows, make sure it does
        -- not contain anything that looks like a drive letter.
-       relf = B.filter (not . skipchar) $ B.dropWhile isPathSeparator $
+       relf = B.dropWhile isPathSeparator $
+               B.filter (not . skipchar) $
                toRawFilePath (fromTestableFilePath pt)
        skipchar b = b == (fromIntegral (ord ':'))
 
index e9c9ce8bb0a104c8777799e4271f2ef9014655f0..ddf04529cfdde44742b3340b191a915ba2bb6d6d 100644 (file)
@@ -51,3 +51,5 @@ Windows 10 version 21H2 (build 19044.1586), 64 bit.
 Git Annex is great. I use it several times a week with my multigigabyte backups, where it gives structure to my image-based backup routines, so you could say I'm a believer. :)
 
 [[!meta author=jkniiv]]
+
+> [[fixed|done]] --[[Joey]]