Skip to content

Commit

Permalink
code polishing
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
paweljakubas committed Aug 6, 2024
1 parent 5217dd0 commit 3027af8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ import Data.ByteString
( ByteString
)
import Data.Maybe
( fromMaybe
( fromJust
, fromMaybe
, isJust
, isNothing
, fromJust
, mapMaybe
)
import Data.Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,16 +479,18 @@ instance Arbitrary TestingSetup where

prop_roundtrip :: TestingSetup -> Property
prop_roundtrip (TestingSetup payload' pwd' _ salt') = do
((mapLeft (const ErrMissingValidEncryptionPayload) $
toMetadataEncrypted pwd' payload' (Just salt')) >>=
fromMetadataEncrypted pwd')
(mapLeft
(const ErrMissingValidEncryptionPayload)
(toMetadataEncrypted pwd' payload' (Just salt'))
>>= fromMetadataEncrypted pwd')
=== Right payload'

prop_passphrase :: TestingSetup -> Expectation
prop_passphrase (TestingSetup payload' pwd1 pwd2 salt') = do
((mapLeft (const ErrMissingValidEncryptionPayload) $
toMetadataEncrypted pwd1 payload' (Just salt')) >>=
fromMetadataEncrypted pwd2)
(mapLeft
(const ErrMissingValidEncryptionPayload)
(toMetadataEncrypted pwd1 payload' (Just salt'))
>>= fromMetadataEncrypted pwd2)
`shouldSatisfy` isLeft

prop_structure_after_enc :: TestingSetup -> Expectation
Expand Down

0 comments on commit 3027af8

Please sign in to comment.