From 150d73c2687c7d94324f102aca8d62792c116444 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Mar 2022 13:53:55 -0400 Subject: [PATCH] fix quickcheck test on windows 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 | 3 ++- ..._prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Utility/Path/Tests.hs b/Utility/Path/Tests.hs index b35e8867d6..88f94b3faa 100644 --- a/Utility/Path/Tests.hs +++ b/Utility/Path/Tests.hs @@ -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 ':')) diff --git a/doc/bugs/test_prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn b/doc/bugs/test_prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn index e9c9ce8bb0..ddf04529cf 100644 --- a/doc/bugs/test_prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn +++ b/doc/bugs/test_prop__95__relPathDirToFileAbs__95__basics_fails_again.mdwn @@ -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]] -- 2.39.5