diff options
author | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-08-17 17:36:35 +0200 |
---|---|---|
committer | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-08-17 17:36:35 +0200 |
commit | bf31e29028a4402ea0d2deefdb3b86efd526acd0 (patch) | |
tree | eaeb9871d201ad092edd901dc4e9091d90166c6d /test | |
parent | 7f9f7386fdbe8d19ef30ebd20939e67cc8bb145c (diff) | |
download | hmacaroons-bf31e29028a4402ea0d2deefdb3b86efd526acd0.tar.gz hmacaroons-bf31e29028a4402ea0d2deefdb3b86efd526acd0.tar.zst hmacaroons-bf31e29028a4402ea0d2deefdb3b86efd526acd0.zip |
Typos and stylish-haskell
Diffstat (limited to 'test')
-rw-r--r-- | test/Crypto/Macaroon/Instances.hs | 4 | ||||
-rw-r--r-- | test/Crypto/Macaroon/Tests.hs | 2 | ||||
-rw-r--r-- | test/Sanity.hs | 26 |
3 files changed, 16 insertions, 16 deletions
diff --git a/test/Crypto/Macaroon/Instances.hs b/test/Crypto/Macaroon/Instances.hs index 6955637..9c89857 100644 --- a/test/Crypto/Macaroon/Instances.hs +++ b/test/Crypto/Macaroon/Instances.hs | |||
@@ -11,9 +11,9 @@ This test suite is based on the pymacaroons test suite: | |||
11 | -} | 11 | -} |
12 | module Crypto.Macaroon.Instances where | 12 | module Crypto.Macaroon.Instances where |
13 | 13 | ||
14 | import Control.Monad | 14 | import Control.Monad |
15 | import Data.Byteable | 15 | import Data.Byteable |
16 | import qualified Data.ByteString as BS | 16 | import qualified Data.ByteString as BS |
17 | import qualified Data.ByteString.Char8 as B8 | 17 | import qualified Data.ByteString.Char8 as B8 |
18 | import Data.Hex | 18 | import Data.Hex |
19 | import Data.List | 19 | import Data.List |
diff --git a/test/Crypto/Macaroon/Tests.hs b/test/Crypto/Macaroon/Tests.hs index 25d77c8..c934cc1 100644 --- a/test/Crypto/Macaroon/Tests.hs +++ b/test/Crypto/Macaroon/Tests.hs | |||
@@ -12,7 +12,7 @@ This test suite is based on the pymacaroons test suite: | |||
12 | module Crypto.Macaroon.Tests where | 12 | module Crypto.Macaroon.Tests where |
13 | 13 | ||
14 | import Data.Byteable | 14 | import Data.Byteable |
15 | import qualified Data.ByteString.Char8 as B8 | 15 | import qualified Data.ByteString.Char8 as B8 |
16 | import Data.Hex | 16 | import Data.Hex |
17 | import Test.Tasty | 17 | import Test.Tasty |
18 | import Test.Tasty.HUnit | 18 | import Test.Tasty.HUnit |
diff --git a/test/Sanity.hs b/test/Sanity.hs index 8def3ca..635e627 100644 --- a/test/Sanity.hs +++ b/test/Sanity.hs | |||
@@ -1,17 +1,17 @@ | |||
1 | {-#LANGUAGE OverloadedStrings#-} | 1 | {-# LANGUAGE OverloadedStrings #-} |
2 | module Sanity where | 2 | module Sanity where |
3 | 3 | ||
4 | import Crypto.Hash | 4 | import Crypto.Hash |
5 | import Data.ByteString (ByteString) | 5 | import Data.Byteable |
6 | import qualified Data.ByteString as B | 6 | import Data.ByteString (ByteString) |
7 | import Data.Hex | 7 | import qualified Data.ByteString as B |
8 | import Data.Byteable | 8 | import Data.Hex |
9 | 9 | ||
10 | import Test.Tasty | 10 | import Test.Tasty |
11 | import Test.Tasty.HUnit | 11 | import Test.Tasty.HUnit |
12 | 12 | ||
13 | import qualified Crypto.Macaroon.Tests | ||
14 | import qualified Crypto.Macaroon.Serializer.Base64.Tests | 13 | import qualified Crypto.Macaroon.Serializer.Base64.Tests |
14 | import qualified Crypto.Macaroon.Tests | ||
15 | 15 | ||
16 | tests :: TestTree | 16 | tests :: TestTree |
17 | tests = testGroup "Python HMAC Sanity check" [ checkKey | 17 | tests = testGroup "Python HMAC Sanity check" [ checkKey |
@@ -44,18 +44,18 @@ mac4 :: ByteString | |||
44 | mac4 = toBytes (hmac mac3 "email = alice@example.org" :: HMAC SHA256) | 44 | mac4 = toBytes (hmac mac3 "email = alice@example.org" :: HMAC SHA256) |
45 | 45 | ||
46 | 46 | ||
47 | checkKey = testCase "Truncated key" $ | 47 | checkKey = testCase "Truncated key" $ |
48 | key @?= "this is our super secret key; on" | 48 | key @?= "this is our super secret key; on" |
49 | 49 | ||
50 | checkMac1 = testCase "HMAC key" $ | 50 | checkMac1 = testCase "HMAC key" $ |
51 | "C60B4B3540BB1B2F2EF28D1C895691CC4A5E07A38A9D3B1C3379FB485293372F" @=? hex mac1 | 51 | "C60B4B3540BB1B2F2EF28D1C895691CC4A5E07A38A9D3B1C3379FB485293372F" @=? hex mac1 |
52 | 52 | ||
53 | checkMac2 = testCase "HMAC key account" $ | 53 | checkMac2 = testCase "HMAC key account" $ |
54 | "5C933DC9A7D036DFCD1740B4F26D737397A1FF635EAC900F3226973503CAAAA5" @=? hex mac2 | 54 | "5C933DC9A7D036DFCD1740B4F26D737397A1FF635EAC900F3226973503CAAAA5" @=? hex mac2 |
55 | 55 | ||
56 | checkMac3 = testCase "HMAC key account time" $ | 56 | checkMac3 = testCase "HMAC key account time" $ |
57 | "7A559B20C8B607009EBCE138C200585E9D0DECA6D23B3EAD6C5E0BA6861D3858" @=? hex mac3 | 57 | "7A559B20C8B607009EBCE138C200585E9D0DECA6D23B3EAD6C5E0BA6861D3858" @=? hex mac3 |
58 | 58 | ||
59 | checkMac4 = testCase "HMAC key account time email" $ | 59 | checkMac4 = testCase "HMAC key account time email" $ |
60 | "E42BBB02A9A5A303483CB6295C497AE51AD1D5CB10003CBE548D907E7E62F5E4" @=? hex mac4 | 60 | "E42BBB02A9A5A303483CB6295C497AE51AD1D5CB10003CBE548D907E7E62F5E4" @=? hex mac4 |
61 | 61 | ||