pem 0.1.0 → 0.1.1
raw patch · 2 files changed
+35/−2 lines, 2 filesdep ~test-frameworkPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: test-framework
API changes (from Hackage documentation)
Files
- Tests/pem.hs +32/−0
- pem.cabal +3/−2
+ Tests/pem.hs view
@@ -0,0 +1,32 @@+module Main where++import Control.Applicative+import Control.Monad++import Test.QuickCheck hiding ((.&.))+import Test.Framework (Test, defaultMain, testGroup)+import Test.Framework.Providers.QuickCheck2 (testProperty)++import Data.PEM+import qualified Data.ByteString as B++main :: IO ()+main = defaultMain tests++tests :: [Test]+tests =+ [ testProperty "marshall" testMarshall+ ]++testMarshall pems = readPems == Right pems+ where readPems = pemParseBS writtenPems+ writtenPems = B.concat (map pemWriteBS pems)++arbitraryName = choose (1, 30) >>= \i -> replicateM i arbitraryAscii+ where arbitraryAscii = elements ['A'..'Z']++arbitraryContent = choose (1,10) >>= \i ->+ (B.pack . map fromIntegral) `fmap` replicateM i (choose (0,255) :: Gen Int)++instance Arbitrary PEM where+ arbitrary = PEM <$> arbitraryName <*> pure [] <*> arbitraryContent
pem.cabal view
@@ -1,5 +1,5 @@ Name: pem-Version: 0.1.0+Version: 0.1.1 Description: Privacy Enhanced Mail (PEM) format reader and writer. License: BSD3 License-file: LICENSE@@ -13,6 +13,7 @@ Cabal-Version: >=1.8 Homepage: http://github.com/vincenthz/hs-pem data-files: README.md+extra-source-files: Tests/pem.hs Library Build-Depends: base >= 3 && < 5@@ -33,7 +34,7 @@ main-is: pem.hs build-depends: base , bytestring- , test-framework >= 0.3.3 && < 0.6+ , test-framework >= 0.3.3 && < 0.7 , test-framework-quickcheck2 >= 0.2.9 && < 0.3 , QuickCheck >= 2.4.0.1 , pem