import qualified Data.ByteString.Char8 as B8
import Test.Tasty
import Test.Tasty.HUnit
+import Test.Tasty.QuickCheck
import Crypto.Macaroon
import Crypto.Macaroon.Serializer.Base64
+import Crypto.Macaroon.Instances
+
tests :: TestTree
tests = testGroup "Crypto.Macaroon.Serializer.Base64" [ basic
+ , basicQC
, minted
, minted2
-- , minted3
]
+basicQC = testProperty "Reversibility" $
+ forAll (macaroon <$> arbitrary) (\m -> deserialize (serialize m) == Right m)
m :: Macaroon
m = create secret key loc