summaryrefslogtreecommitdiff
path: root/Annex/Content
diff options
context:
space:
mode:
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