fix test failure on windows
authorJoey Hess <joeyh@joeyh.name>
Thu, 26 Nov 2020 15:48:52 +0000 (11:48 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 26 Nov 2020 15:48:52 +0000 (11:48 -0400)
"a:" failed; this test wants a relative filename so isDrive avoids it

Note that on linux, isDrive "/foo" is true. This test also filters out
absolute paths already, so that is ok.

This commit was sponsored by Brock Spratlen on Patreon.

Annex/View/ViewedFile.hs

index fccf9b48ecd1f6a5733d0572b35fe1ce5a65643d..a775da7dad399e6a547313f9ce2150e54afac118 100644 (file)
@@ -83,7 +83,7 @@ prop_viewedFile_roundtrips :: TestableFilePath -> Bool
 prop_viewedFile_roundtrips tf
        -- Relative filenames wanted, not directories.
        | any (isPathSeparator) (end f ++ beginning f) = True
-       | isAbsolute f = True
+       | isAbsolute f || isDrive f = True
        | otherwise = dir == dirFromViewedFile (viewedFileFromReference f)
   where
        f = fromTestableFilePath tf