more quickcheck fun
This commit is contained in:
parent
bf71d42681
commit
ddb0adb998
3 changed files with 30 additions and 13 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue