-
-
Save dminuoso/dd9faad54d7719392319032ed8430916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arbitraryPass :: Int -> Gen BS.ByteString | |
arbitraryPass l = do | |
i <- chooseInt (0, l) | |
BS8.pack <$> vectorOf i arbitraryPrintableChar | |
qc_crypto :: TestTree | |
qc_crypto = testGroup "Crytographic functions" $ | |
[ testProperty "encodePassword/decodePassword roundtrip" $ | |
forAll (liftA3 (,,) arbitraryBS16 arbitraryBS16 (arbitraryPass 33)) $ \(auth,sec,pass) -> | |
Just pass === decodePassword auth (Secret sec) (encodePassword auth (Secret sec) pass) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Crytographic functions | |
encodePassword/decodePassword rountrip: FAIL | |
*** Failed! Falsified (after 59 tests): | |
("\214\188x\SYN\158\&3d\208{w\224v\212\208\&9$","\141&[\176\159C\134\195\186\195\DC3\192K2\EOT\191","`p\NUL") | |
Just "`p\NUL" /= Just "`p" | |
Use --quickcheck-replay=864535 to reproduce. | |
Use -p '/encodePassword\/decodePassword rountrip/' to rerun this test only. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment