File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import System.Posix.Directory
10
10
import System.Posix.IO
11
11
import Control.Exception as E
12
12
import Control.Monad
13
+ import Test.Tasty.HUnit
13
14
14
15
main = do
15
16
cleanup
@@ -70,24 +71,16 @@ testLink = do
70
71
createLink regular hlink_regular
71
72
(fs, _) <- getStatus regular -- we need to retrieve it again as creating the link causes it to change!
72
73
(fs', ls) <- getStatus hlink_regular
73
- let expected = (
74
+ snd (statusElements ls) @? = (
74
75
False , -- isBlockDevice
75
76
False , -- isCharacterDevice
76
77
False , -- isNamedPipe
77
78
True , -- isRegularFile
78
79
False , -- isDirectory
79
80
False , -- isSymbolicLink
80
81
False ) -- isSocket
81
- actualF = snd (statusElements ls)
82
-
83
- when (actualF /= expected) $
84
- fail " unexpected file status bits for hard link to regular file"
85
-
86
- when (linkCount fs' /= 2 ) $
87
- fail " newly created hard link was expected to contain have a link count of 2"
88
-
89
- when (statusElements fs /= statusElements fs') $
90
- fail " status for a file does not match when it's accessed via a link"
82
+ linkCount fs' == 2 @? " Newly created hard link was expected to have a link count of 2"
83
+ statusElements fs @?= statusElements fs' -- status for a file should match when accessed via a link
91
84
92
85
93
86
cleanup = do
You can’t perform that action at this time.
0 commit comments