File tree 1 file changed +9
-2
lines changed
tests/filepath-equivalent-tests
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
{-# LANGUAGE CPP #-}
2
- {-# LANGUAGE TypeApplications #-}
3
2
4
3
module Main where
5
4
@@ -11,6 +10,7 @@ import qualified System.FilePath.Windows as W
11
10
import qualified System.FilePath.Posix as P
12
11
import qualified Legacy.System.FilePath.Windows as LW
13
12
import qualified Legacy.System.FilePath.Posix as LP
13
+ import Data.Char (isAsciiLower , isAsciiUpper )
14
14
15
15
16
16
main :: IO ()
@@ -189,7 +189,14 @@ equivalentTests =
189
189
)
190
190
,
191
191
( " normalise (windows)"
192
- , property $ \ p -> W. normalise p == LW. normalise p
192
+ , property $ \ p -> case p of
193
+ (l: ' :' : rs)
194
+ -- new filepath normalises "a:////////" to "A:\\"
195
+ -- see https://github.com/haskell/filepath/commit/cb4890aa03a5ee61f16f7a08dd2d964fffffb385
196
+ | isAsciiLower l || isAsciiUpper l
197
+ , let (seps, path) = span LW. isPathSeparator rs
198
+ , length seps > 1 -> let np = l : ' :' : LW. pathSeparator : path in W. normalise np == LW. normalise np
199
+ _ -> W. normalise p == LW. normalise p
193
200
)
194
201
,
195
202
( " equalFilePath (windows)"
You can’t perform that action at this time.
0 commit comments