diff options
Diffstat (limited to 'tests/suite.hs')
-rw-r--r-- | tests/suite.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/suite.hs b/tests/suite.hs index 3a7b7eb..a8b5a30 100644 --- a/tests/suite.hs +++ b/tests/suite.hs | |||
@@ -67,25 +67,25 @@ testArmorEncode :: [FilePath] -> FilePath -> Assertion | |||
67 | testArmorEncode fps target = do | 67 | testArmorEncode fps target = do |
68 | bss <- mapM (\fp -> BL.readFile $ "tests/data/" ++ fp) fps | 68 | bss <- mapM (\fp -> BL.readFile $ "tests/data/" ++ fp) fps |
69 | tbs <- BL.readFile $ "tests/data/" ++ target | 69 | tbs <- BL.readFile $ "tests/data/" ++ target |
70 | assertEqual ("literaldata") tbs (encodeLazy (map (\bs -> Armor ArmorMessage [("Version","OpenPrivacy 0.99")] bs) bss)) | 70 | assertEqual "literaldata" tbs (encodeLazy (map (Armor ArmorMessage [("Version","OpenPrivacy 0.99")]) bss)) |
71 | 71 | ||
72 | testClearsignedEncode :: FilePath -> FilePath -> FilePath -> Assertion | 72 | testClearsignedEncode :: FilePath -> FilePath -> FilePath -> Assertion |
73 | testClearsignedEncode ftxt fsig ftarget = do | 73 | testClearsignedEncode ftxt fsig ftarget = do |
74 | txt <- BL.readFile $ "tests/data/" ++ ftxt | 74 | txt <- BL.readFile $ "tests/data/" ++ ftxt |
75 | sig <- BL.readFile $ "tests/data/" ++ fsig | 75 | sig <- BL.readFile $ "tests/data/" ++ fsig |
76 | target <- BL.readFile $ "tests/data/" ++ ftarget | 76 | target <- BL.readFile $ "tests/data/" ++ ftarget |
77 | assertEqual ("clearsigned encode") target (encodeLazy [ClearSigned [("Hash","SHA1")] txt (Armor ArmorSignature [("Version","OpenPrivacy 0.99")] sig)]) | 77 | assertEqual "clearsigned encode" target (encodeLazy [ClearSigned [("Hash","SHA1")] txt (Armor ArmorSignature [("Version","OpenPrivacy 0.99")] sig)]) |
78 | 78 | ||
79 | testStrictDecode :: FilePath -> Assertion | 79 | testStrictDecode :: FilePath -> Assertion |
80 | testStrictDecode fp = do | 80 | testStrictDecode fp = do |
81 | bs <- BL.readFile $ "tests/data/" ++ fp | 81 | bs <- BL.readFile $ "tests/data/" ++ fp |
82 | assertEqual ("strict decode") (decodeLazy bs :: Either String [Armor]) (decode (B.concat . BL.toChunks $ bs) :: Either String [Armor]) | 82 | assertEqual "strict decode" (decodeLazy bs :: Either String [Armor]) (decode (B.concat . BL.toChunks $ bs) :: Either String [Armor]) |
83 | 83 | ||
84 | testStrictEncode :: FilePath -> Assertion | 84 | testStrictEncode :: FilePath -> Assertion |
85 | testStrictEncode fp = do | 85 | testStrictEncode fp = do |
86 | bs <- BL.readFile $ "tests/data/" ++ fp | 86 | bs <- BL.readFile $ "tests/data/" ++ fp |
87 | let fakearmors = [Armor ArmorMessage [("Version","OpenPrivacy 0.99")] bs, ClearSigned [("Hash","SHA1")] bs (Armor ArmorSignature [("Version","OpenPrivacy 0.99")] bs)] | 87 | let fakearmors = [Armor ArmorMessage [("Version","OpenPrivacy 0.99")] bs, ClearSigned [("Hash","SHA1")] bs (Armor ArmorSignature [("Version","OpenPrivacy 0.99")] bs)] |
88 | assertEqual ("strict encode") (encodeLazy fakearmors) (BL.fromChunks [(encode fakearmors)]) | 88 | assertEqual "strict encode" (encodeLazy fakearmors) (BL.fromChunks [encode fakearmors]) |
89 | 89 | ||
90 | tests :: TestTree | 90 | tests :: TestTree |
91 | tests = testGroup "openpgp-asciiarmor" [ | 91 | tests = testGroup "openpgp-asciiarmor" [ |