Skip to content

Commit 09cc71a

Browse files
committed
Fix warnings in tests
1 parent bb0e91e commit 09cc71a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/Codec/Archive/Tar/Index/StringTable/Tests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ prop_sorted strings = property $
4949
where
5050
_tbl :: StringTable Int
5151
_tbl@(StringTable strs offsets ids _ixs) = construct strings
52-
isSorted xs = and (zipWith (<) xs (tail xs))
52+
isSorted xs = and (zipWith (<) xs (drop 1 xs))
5353

5454
prop_finalise_unfinalise :: [BS.ByteString] -> Property
5555
prop_finalise_unfinalise strs =

test/Codec/Archive/Tar/Index/Tests.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ prop_lookup (ValidPaths paths) (NonEmptyFilePath p) =
7070
_ -> property False
7171
where
7272
index = construct paths
73-
completions = [ head (FilePath.splitDirectories completion)
73+
completions = [ hd
7474
| (path,_) <- paths
75-
, completion <- maybeToList $ stripPrefix (p ++ "/") path ]
75+
, completion <- maybeToList $ stripPrefix (p ++ "/") path
76+
, let hd : _ = FilePath.splitDirectories completion ]
7677

7778
prop_toList :: ValidPaths -> Property
7879
prop_toList (ValidPaths paths) =

0 commit comments

Comments
 (0)