From 7eb54bad12ceced30ff6bfa907ec8e417391d2e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2021 13:19:17 -0400 Subject: [PATCH] fix prop_relPathDirToFileAbs_basics fail on windows It was just slapping on a path separator to the front of the path to make it absolute, but on windows, a path like "//foo/bar" actually has a network "drive" of "//foo" and so that broke the test case. Since "a:foo" is a somehow relative path on windows (who knows how), drop any drive from the input. But dropDrive also drops any leading path separator, making the input path relative. So now it should be safe to slapp on a leading path separator. --- Utility/Path/Tests.hs | 5 ++++- ..._95__relPathDirToFileAbs__95__basics_started_to_fail.mdwn | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Utility/Path/Tests.hs b/Utility/Path/Tests.hs index 2d9c6152aa..c09151e4cd 100644 --- a/Utility/Path/Tests.hs +++ b/Utility/Path/Tests.hs @@ -42,7 +42,10 @@ prop_relPathDirToFileAbs_basics pt = and , relPathDirToFileAbs p p == "" ] where - p = pathSeparator `B.cons` toRawFilePath (fromTestableFilePath pt) + -- Make the input an absolute path, since relPathDirToFileAbs + -- needs absolute paths. + p = pathSeparator `B.cons` dropDrive + (toRawFilePath (fromTestableFilePath pt)) prop_relPathDirToFileAbs_regressionTest :: Bool prop_relPathDirToFileAbs_regressionTest = same_dir_shortcurcuits_at_difference diff --git a/doc/bugs/W__58__prop__95__relPathDirToFileAbs__95__basics_started_to_fail.mdwn b/doc/bugs/W__58__prop__95__relPathDirToFileAbs__95__basics_started_to_fail.mdwn index 6c7b92b284..8f400439df 100644 --- a/doc/bugs/W__58__prop__95__relPathDirToFileAbs__95__basics_started_to_fail.mdwn +++ b/doc/bugs/W__58__prop__95__relPathDirToFileAbs__95__basics_started_to_fail.mdwn @@ -15,3 +15,5 @@ full list of recent runs with logs etc: [datalad/git-annex github actions](https [[!meta author=yoh]] [[!tag projects/datalad]] + +> [[fixed|done]] --[[Joey]] -- 2.30.2