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.hs28
1 files changed, 7 insertions, 21 deletions
diff --git a/test/Crypto/Macaroon/Verifier/Tests.hs b/test/Crypto/Macaroon/Verifier/Tests.hs
index 670c991..b6220eb 100644
--- a/test/Crypto/Macaroon/Verifier/Tests.hs
+++ b/test/Crypto/Macaroon/Verifier/Tests.hs
@@ -12,21 +12,20 @@ This test suite is based on the pymacaroons test suite:
12module Crypto.Macaroon.Verifier.Tests where 12module Crypto.Macaroon.Verifier.Tests where
13 13
14 14
15import Data.List 15import qualified Data.ByteString.Char8 as B8
16import qualified Data.ByteString.Char8 as B8 16import Data.List
17import Test.Tasty 17import Test.Tasty
18-- import Test.Tasty.HUnit 18-- import Test.Tasty.HUnit
19import Test.Tasty.QuickCheck hiding (Success, Failure) 19import Data.Either
20import Data.Either 20import Test.Tasty.QuickCheck hiding (Failure, Success)
21 21
22import Crypto.Macaroon 22import Crypto.Macaroon
23import Crypto.Macaroon.Verifier 23import Crypto.Macaroon.Verifier
24 24
25import Crypto.Macaroon.Instances 25import Crypto.Macaroon.Instances
26 26
27tests :: TestTree 27tests :: TestTree
28tests = testGroup "Crypto.Macaroon.Verifier" [ sigs 28tests = testGroup "Crypto.Macaroon.Verifier" [ ]
29 ]
30 29
31{- 30{-
32 - Test fixtures 31 - Test fixtures
@@ -45,22 +44,9 @@ m2 = addFirstPartyCaveat "test = caveat" m
45m3 :: Macaroon 44m3 :: Macaroon
46m3 = addFirstPartyCaveat "value = 42" m2 45m3 = addFirstPartyCaveat "value = 42" m2
47 46
48-- exTC = verifyExact "test" "caveat" (many' letter_ascii)
49-- exTZ = verifyExact "test" "bleh" (many' letter_ascii)
50-- exV42 = verifyExact "value" 42 decimal
51-- exV43 = verifyExact "value" 43 decimal
52
53-- funTCPre = verifyFun "test" (string "test = " *> many' letter_ascii)
54-- (\e -> if "cav" `isPrefixOf` e then Right e else Left "Does not start with cav" )
55-- funTV43lte = verifyFun "value" (string "value = " *> decimal)
56-- (\v -> if v <= 43 then Right v else Left "Greater than 43")
57
58-- allvs = [exTC, exTZ, exV42, exV43, funTCPre, funTV43lte]
59
60{- 47{-
61 - Tests 48 - Tests
62 -} 49 -}
63sigs = testProperty "Signatures" $ \sm -> verifySig (secret sm) (macaroon sm) == Right (macaroon sm)
64 50
65-- TODO: Re-do tests 51-- TODO: Re-do tests
66{- 52{-