diff options
Diffstat (limited to 'test/Crypto/Macaroon')
-rw-r--r-- | test/Crypto/Macaroon/Verifier/Internal/Tests.hs | 12 |
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 | |||
45 | m2 :: Macaroon | 45 | m2 :: Macaroon |
46 | m2 = addFirstPartyCaveat "test = caveat" m | 46 | m2 = addFirstPartyCaveat "test = caveat" m |
47 | 47 | ||
48 | vtest :: Caveat -> IO (Maybe (Either ValidationError ())) | 48 | vtest :: Caveat -> IO VerifierResult |
49 | vtest c = return $ if "test" `BS.isPrefixOf` cid c then | 49 | vtest 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 | ||
54 | m3 :: Macaroon | 54 | m3 :: Macaroon |
55 | m3 = addFirstPartyCaveat "value = 42" m2 | 55 | m3 = addFirstPartyCaveat "value = 42" m2 |
56 | 56 | ||
57 | vval :: Caveat -> IO (Maybe (Either ValidationError ())) | 57 | vval :: Caveat -> IO VerifierResult |
58 | vval c = return $ if "value" `BS.isPrefixOf` cid c then | 58 | vval 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 | {- |