aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Crypto/Macaroon/Verifier/Internal/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Crypto/Macaroon/Verifier/Internal/Tests.hs')
-rw-r--r--test/Crypto/Macaroon/Verifier/Internal/Tests.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/Crypto/Macaroon/Verifier/Internal/Tests.hs b/test/Crypto/Macaroon/Verifier/Internal/Tests.hs
index 826b631..59980de 100644
--- a/test/Crypto/Macaroon/Verifier/Internal/Tests.hs
+++ b/test/Crypto/Macaroon/Verifier/Internal/Tests.hs
@@ -45,19 +45,19 @@ m = create sec key loc
45m2 :: Macaroon 45m2 :: Macaroon
46m2 = addFirstPartyCaveat "test = caveat" m 46m2 = addFirstPartyCaveat "test = caveat" m
47 47
48vtest :: Caveat -> IO (Maybe (Either ValidationError ())) 48vtest :: Caveat -> IO VerifierResult
49vtest c = return $ if "test" `BS.isPrefixOf` cid c then 49vtest c = return $ if "test" `BS.isPrefixOf` cid c then
50 Just $ bool (Left (ValidatorError "Failed")) (Right ()) $ "test = caveat" == cid c 50 bool (Refused (ValidatorError "Failed")) Verified $ "test = caveat" == cid c
51 else Nothing 51 else Unrelated
52 52
53 53
54m3 :: Macaroon 54m3 :: Macaroon
55m3 = addFirstPartyCaveat "value = 42" m2 55m3 = addFirstPartyCaveat "value = 42" m2
56 56
57vval :: Caveat -> IO (Maybe (Either ValidationError ())) 57vval :: Caveat -> IO VerifierResult
58vval c = return $ if "value" `BS.isPrefixOf` cid c then 58vval c = return $ if "value" `BS.isPrefixOf` cid c then
59 Just $ bool (Left (ValidatorError "Failed")) (Right ()) $ "value = 42" == cid c 59 bool (Refused (ValidatorError "Failed")) Verified $ "value = 42" == cid c
60 else Nothing 60 else Unrelated
61 61
62 62
63{- 63{-