summaryrefslogtreecommitdiff
path: root/Key.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-06-17 13:04:48 -0400
committerJoey Hess <joeyh@joeyh.name>2017-06-17 13:04:48 -0400
commit75cecbbe3fdafdb6652e95ac17cd755c28e67f20 (patch)
treef58346351ff441cda31e22176fa6f9b7d6c36a9b /Key.hs
parent27f7c8d09ab72558e03d7f6bac843b1d0a725936 (diff)
Fix build with QuickCheck 2.10.
QuickCheck added an Arbitrary instance for CTime aka EpochTime. However, while git-annex's instance disallowed times before the epoch, QuickCheck's does not. So, rather than using its instance, convert from an Integer. This commit was sponsored by Thomas Hochstein on Patreon.
Diffstat (limited to 'Key.hs')
-rw-r--r--Key.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Key.hs b/Key.hs
index 8672c827c1..44e9acea4e 100644
--- a/Key.hs
+++ b/Key.hs
@@ -147,7 +147,7 @@ instance Arbitrary Key where
<$> (listOf1 $ elements $ ['A'..'Z'] ++ ['a'..'z'] ++ ['0'..'9'] ++ "-_\r\n \t")
<*> (parseKeyVariety <$> (listOf1 $ elements ['A'..'Z'])) -- BACKEND
<*> ((abs <$>) <$> arbitrary) -- size cannot be negative
- <*> arbitrary
+ <*> ((abs . fromInteger <$>) <$> arbitrary) -- mtime cannot be negative
<*> ((abs <$>) <$> arbitrary) -- chunksize cannot be negative
<*> ((succ . abs <$>) <$> arbitrary) -- chunknum cannot be 0 or negative