Skip to content

Commit 846d15b

Browse files
Remove ignoringError and enable Eloop, EACCESS errors
It seems in one macOS CI symlinks are not being followed. So this is for debugging.
1 parent 16a0220 commit 846d15b

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

test/Streamly/Test/FileSystem/DirIO.hs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module Main (main) where
1717
-- Imports
1818
--------------------------------------------------------------------------------
1919

20-
import Control.Exception (try, IOException)
2120
import Data.Word (Word8)
2221
import GHC.IO.Encoding (setLocaleEncoding, utf8)
2322
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
@@ -70,11 +69,6 @@ testCorrectnessByteChunked expectation lister = do
7069
reality `shouldBe` expectation
7170
#endif
7271

73-
ignoringError :: IO a -> IO ()
74-
ignoringError act = do
75-
(_ :: Either IOException a) <- try act
76-
pure ()
77-
7872
testSymLinkFollow :: Spec
7973
testSymLinkFollow = do
8074
let fp = "benchmark-tmp/dir-structure-small-sym"
@@ -87,7 +81,7 @@ testSymLinkFollow = do
8781
$ StreamK.toStream
8882
$ StreamK.sortBy compare
8983
$ StreamK.fromStream $ Stream.fromList pathsUnsorted
90-
runIO $ ignoringError $ do
84+
runIO $ do
9185
createDirectoryLink "./dir_1" (fp ++ "/sym-link-1")
9286
createDirectoryLink "./dir_1/dir_2" (fp ++ "/sym-link-2")
9387
createDirectoryLink "./broken_link" (fp ++ "/sym-link-3")
@@ -118,13 +112,21 @@ testSymLinkFollow = do
118112
testCorrectness
119113
sortedAnswerFollowSym
120114
(listDirUnfoldDfs
121-
(Dir.followSymlinks True . Dir.ignoreMissing True)
115+
( Dir.followSymlinks True
116+
. Dir.ignoreMissing True
117+
. Dir.ignoreInaccessible False
118+
. Dir.ignoreSymlinkLoops False
119+
)
122120
fp)
123121
it "followSymlinks False" $
124122
testCorrectness
125123
sortedAnswerNoFollowSym
126124
(listDirUnfoldDfs
127-
(Dir.followSymlinks False . Dir.ignoreMissing True)
125+
( Dir.followSymlinks False
126+
. Dir.ignoreMissing True
127+
. Dir.ignoreInaccessible False
128+
. Dir.ignoreSymlinkLoops False
129+
)
128130
fp)
129131

130132
-- | List the current directory recursively

0 commit comments

Comments
 (0)