summaryrefslogtreecommitdiff
path: root/Annex/Content
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-19 16:36:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-19 16:36:19 -0400
commit61307263c9ec3627df867836fc7e4db812c54621 (patch)
treeaf9cf913e56ae8489441a655a468cac7b92d11a1 /Annex/Content
parent271bec8c70920322fee13a052df4a9279255e698 (diff)
more quickcheck fun
Diffstat (limited to 'Annex/Content')
-rw-r--r--Annex/Content/Direct.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 64182ddc6..75a32e3fc 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -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