X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=test%2FCrypto%2FMacaroon%2FVerifier%2FTests.hs;h=d69ad8dee100d7d3312fa0fcbcdf3e0ebbc027e2;hb=cfeb65a103cb58048328b2ca3ce74351017f70d1;hp=f87f192d94e9ab716c9e44aaa90ac8b1e162505b;hpb=5d1b7d51854d355bf5b6438c1a96ce9e743fd810;p=github%2Ffretlink%2Fhmacaroons.git diff --git a/test/Crypto/Macaroon/Verifier/Tests.hs b/test/Crypto/Macaroon/Verifier/Tests.hs index f87f192..d69ad8d 100644 --- a/test/Crypto/Macaroon/Verifier/Tests.hs +++ b/test/Crypto/Macaroon/Verifier/Tests.hs @@ -12,19 +12,20 @@ This test suite is based on the pymacaroons test suite: module Crypto.Macaroon.Verifier.Tests where -import qualified Data.ByteString.Char8 as B8 -import Test.Tasty -import Test.Tasty.HUnit -import Test.Tasty.QuickCheck +import qualified Data.ByteString.Char8 as B8 +import Data.Either +import Data.List +import Test.Tasty +import Test.Tasty.HUnit +import Test.Tasty.QuickCheck import Crypto.Macaroon import Crypto.Macaroon.Verifier -import Crypto.Macaroon.Instances +import Crypto.Macaroon.Instances tests :: TestTree -tests = testGroup "Crypto.Macaroon.Verifier" [ sigs - ] +tests = testGroup "Crypto.Macaroon.Verifier" [ ] {- - Test fixtures @@ -41,27 +42,10 @@ m2 :: Macaroon m2 = addFirstPartyCaveat "test = caveat" m m3 :: Macaroon -m3 = addFirstPartyCaveat "test = acaveat" m +m3 = addFirstPartyCaveat "value = 42" m2 {- - Tests -} -sigs = testGroup "Signatures" [ basic - , one - , two - ] - -basic = testGroup "Basic Macaroon" [ none , sigQC ] - -none = testCase "No caveat" $ - VSuccess @=? verifySig sec m - -sigQC = testProperty "Random" $ - \sm -> verifySig (secret sm) (macaroon sm) == VSuccess - -one = testCase "Macaroon with one caveat" $ - VSuccess @=? verifySig sec m2 - -two = testCase "Macaroon with two caveats" $ - VSuccess @=? verifySig sec m3 +-- TODO