Merge branch 'master' into v8

This commit is contained in:
Joey Hess 2020-01-01 14:26:43 -04:00
commit 2cea674d1e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
44 changed files with 665 additions and 140 deletions

5
Key.hs
View file

@ -81,10 +81,9 @@ instance Arbitrary KeyData where
-- AssociatedFile cannot be empty, and cannot contain a NUL
-- (but can be Nothing)
instance Arbitrary AssociatedFile where
arbitrary = (AssociatedFile . fmap mk <$> arbitrary)
arbitrary = (AssociatedFile . fmap toRawFilePath <$> arbitrary)
`suchThat` (/= AssociatedFile (Just S.empty))
where
mk = toRawFilePath . filter (/= '\NUL')
`suchThat` (\(AssociatedFile f) -> maybe True (S.notElem 0) f)
instance Arbitrary Key where
arbitrary = mkKey . const <$> arbitrary