summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2018-03-28 21:42:21 -0400
committerClint Adams <clint@debian.org>2018-03-28 21:42:21 -0400
commit55fa003d68c79ee928fbcdef0c922e333282afe9 (patch)
treefd6bf1039279e79fa5df90974ba7a41f05ceeb81
parent84be1061b6fb322e23b2be753f47d4321b8179b2 (diff)
Switch from test-framework to tasty
-rw-r--r--openpgp-asciiarmor.cabal5
-rw-r--r--tests/suite.hs10
2 files changed, 6 insertions, 9 deletions
diff --git a/openpgp-asciiarmor.cabal b/openpgp-asciiarmor.cabal
index 82063dd..0feac1d 100644
--- a/openpgp-asciiarmor.cabal
+++ b/openpgp-asciiarmor.cabal
@@ -54,9 +54,8 @@ Test-Suite tests
54 , base64-bytestring 54 , base64-bytestring
55 , bytestring 55 , bytestring
56 , cereal 56 , cereal
57 , HUnit 57 , tasty
58 , test-framework 58 , tasty-hunit
59 , test-framework-hunit
60 default-language: Haskell2010 59 default-language: Haskell2010
61 60
62Benchmark benchmark 61Benchmark benchmark
diff --git a/tests/suite.hs b/tests/suite.hs
index 5ad3d05..3a7b7eb 100644
--- a/tests/suite.hs
+++ b/tests/suite.hs
@@ -1,7 +1,5 @@
1import Test.Framework (defaultMain, testGroup, Test) 1import Test.Tasty (defaultMain, testGroup, TestTree)
2import Test.Framework.Providers.HUnit 2import Test.Tasty.HUnit (Assertion, assertEqual, assertFailure, testCase)
3
4import Test.HUnit (Assertion, assertEqual, assertFailure)
5 3
6import Codec.Encryption.OpenPGP.ASCIIArmor (decode, decodeLazy, encode, encodeLazy, multipartMerge) 4import Codec.Encryption.OpenPGP.ASCIIArmor (decode, decodeLazy, encode, encodeLazy, multipartMerge)
7import Codec.Encryption.OpenPGP.ASCIIArmor.Types 5import Codec.Encryption.OpenPGP.ASCIIArmor.Types
@@ -89,8 +87,8 @@ testStrictEncode fp = do
89 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)]
90 assertEqual ("strict encode") (encodeLazy fakearmors) (BL.fromChunks [(encode fakearmors)]) 88 assertEqual ("strict encode") (encodeLazy fakearmors) (BL.fromChunks [(encode fakearmors)])
91 89
92tests :: [Test] 90tests :: TestTree
93tests = [ 91tests = testGroup "openpgp-asciiarmor" [
94 testGroup "CRC24" [ 92 testGroup "CRC24" [
95 testCase "CRC24: A" (testCRC24 (BC8.pack "A") 16680698) 93 testCase "CRC24: A" (testCRC24 (BC8.pack "A") 16680698)
96 , testCase "CRC24: Haskell" (testCRC24 (BC8.pack "Haskell") 15612750) 94 , testCase "CRC24: Haskell" (testCRC24 (BC8.pack "Haskell") 15612750)