From 7d132bf7791f57c43f4928aa0824cf98c313426f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 9 Nov 2018 14:58:37 +0100 Subject: [PATCH] Minor cleanup --- test/Handler/Utils/ZipSpec.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/Handler/Utils/ZipSpec.hs b/test/Handler/Utils/ZipSpec.hs index b18dbe8ab..031a7d153 100644 --- a/test/Handler/Utils/ZipSpec.hs +++ b/test/Handler/Utils/ZipSpec.hs @@ -20,7 +20,7 @@ instance Arbitrary File where arbitrary = do fileTitle <- (joinPath <$> arbitrary) `suchThat` (any $ not . isPathSeparator) date <- addDays <$> arbitrary <*> pure (fromGregorian 2043 7 2) - fileModified <- addUTCTime <$> arbitrary <*> pure (UTCTime date 0) + fileModified <- (addUTCTime <$> arbitrary <*> pure (UTCTime date 0)) `suchThat` inZipRange fileContent <- arbitrary return File{..} shrink = genericShrink @@ -35,8 +35,7 @@ spec = describe "Zip file handling" $ do = makeValid . dropWhile isPathSeparator . bool (dropWhileEnd isPathSeparator) addTrailingPathSeparator (isNothing $ fileContent file) . normalise . makeValid acceptableTimeDifference t1 t2 = abs (diffUTCTime t1 t2) <= 2 (shouldBe `on` acceptableFilenameChanges) (fileTitle file') (fileTitle file) - when (inZipRange $ fileModified file) $ - (fileModified file', fileModified file) `shouldSatisfy` uncurry acceptableTimeDifference + (fileModified file', fileModified file) `shouldSatisfy` uncurry acceptableTimeDifference (fileContent file') `shouldBe` (fileContent file) inZipRange :: UTCTime -> Bool