more quickcheck fun

This commit is contained in:
Joey Hess 2012-12-19 16:36:19 -04:00
parent bf71d42681
commit ddb0adb998
3 changed files with 30 additions and 13 deletions

View file

@ -17,7 +17,8 @@ module Annex.Content.Direct (
removeCache,
genCache,
toCache,
Cache
Cache(..),
prop_read_show_direct
) where
import Common.Annex
@ -123,6 +124,10 @@ readCache s = case words s of
<*> readish mtime
_ -> Nothing
-- for quickcheck
prop_read_show_direct :: Cache -> Bool
prop_read_show_direct c = readCache (showCache c) == Just c
genCache :: FilePath -> IO (Maybe Cache)
genCache f = catchDefaultIO Nothing $ toCache <$> getFileStatus f