aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Crypto/Macaroon/Verifier/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Crypto/Macaroon/Verifier/Tests.hs')
-rw-r--r--test/Crypto/Macaroon/Verifier/Tests.hs44
1 files changed, 4 insertions, 40 deletions
diff --git a/test/Crypto/Macaroon/Verifier/Tests.hs b/test/Crypto/Macaroon/Verifier/Tests.hs
index b6220eb..d69ad8d 100644
--- a/test/Crypto/Macaroon/Verifier/Tests.hs
+++ b/test/Crypto/Macaroon/Verifier/Tests.hs
@@ -13,11 +13,11 @@ module Crypto.Macaroon.Verifier.Tests where
13 13
14 14
15import qualified Data.ByteString.Char8 as B8 15import qualified Data.ByteString.Char8 as B8
16import Data.Either
16import Data.List 17import Data.List
17import Test.Tasty 18import Test.Tasty
18-- import Test.Tasty.HUnit 19import Test.Tasty.HUnit
19import Data.Either 20import Test.Tasty.QuickCheck
20import Test.Tasty.QuickCheck hiding (Failure, Success)
21 21
22import Crypto.Macaroon 22import Crypto.Macaroon
23import Crypto.Macaroon.Verifier 23import Crypto.Macaroon.Verifier
@@ -48,40 +48,4 @@ m3 = addFirstPartyCaveat "value = 42" m2
48 - Tests 48 - Tests
49 -} 49 -}
50 50
51-- TODO: Re-do tests 51-- TODO
52{-
53firstParty = testGroup "First party caveats" [
54 testGroup "Pure verifiers" [
55 testProperty "Zero caveat" $
56 forAll (sublistOf allvs) (\vs -> Right m == verifyCavs vs m)
57 , testProperty "One caveat" $
58 forAll (sublistOf allvs) (\vs -> disjoin [
59 Right m2 == verifyCavs vs m2 .&&. any (`elem` vs) [exTC,funTCPre] .&&. (exTZ `notElem` vs)
60 , True === isLeft( verifyCavs vs m2)
61 ])
62 , testProperty "Two Exact" $
63 forAll (sublistOf allvs) (\vs -> disjoin [
64 Right m3 == verifyCavs vs m3 .&&.
65 any (`elem` vs) [exTC,funTCPre] .&&. (exTZ `notElem` vs) .&&.
66 any (`elem` vs) [exV42,funTV43lte] .&&. (exV43 `notElem` vs)
67 , True === isLeft (verifyCavs vs m3)
68 ])
69 ]
70 , testGroup "Pure verifiers with sig" [
71 testProperty "Zero caveat" $
72 forAll (sublistOf allvs) (\vs -> Right m == verifyMacaroon sec vs m)
73 , testProperty "One caveat" $
74 forAll (sublistOf allvs) (\vs -> disjoin [
75 Right m2 == verifyMacaroon sec vs m2 .&&. any (`elem` vs) [exTC,funTCPre] .&&. (exTZ `notElem` vs)
76 , True === isLeft (verifyMacaroon sec vs m2)
77 ])
78 , testProperty "Two Exact" $
79 forAll (sublistOf allvs) (\vs -> disjoin [
80 Right m3 == verifyMacaroon sec vs m3 .&&.
81 any (`elem` vs) [exTC,funTCPre] .&&. (exTZ `notElem` vs) .&&.
82 any (`elem` vs) [exV42,funTV43lte] .&&. (exV43 `notElem` vs)
83 , True === isLeft (verifyMacaroon sec vs m3)
84 ])
85 ]
86 ]
87 -}