From a22bcdb648d1f540ae895cb246997dcdcce7b568 Mon Sep 17 00:00:00 2001 From: Julien Tanguy Date: Wed, 15 Apr 2015 15:30:28 +0200 Subject: Add quickchecked serialization properties --- test/Crypto/Macaroon/Serializer/Base64/Tests.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/Crypto/Macaroon/Serializer/Base64') diff --git a/test/Crypto/Macaroon/Serializer/Base64/Tests.hs b/test/Crypto/Macaroon/Serializer/Base64/Tests.hs index 9c49e96..fe5352e 100644 --- a/test/Crypto/Macaroon/Serializer/Base64/Tests.hs +++ b/test/Crypto/Macaroon/Serializer/Base64/Tests.hs @@ -15,17 +15,23 @@ module Crypto.Macaroon.Serializer.Base64.Tests where 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 -- cgit v1.2.3