text-ldap 0.1.1.3 → 0.1.1.4
raw patch · 5 files changed
+14/−77 lines, 5 filesdep +cabal-test-compatPVP ok
version bump matches the API change (PVP)
Dependencies added: cabal-test-compat
API changes (from Hackage documentation)
Files
- test/Error.hs +0/−8
- test/PrintParse.hs +10/−11
- test114/Suite.hs +0/−35
- test114/Tests.hs +0/−8
- text-ldap.cabal +4/−15
− test/Error.hs
@@ -1,8 +0,0 @@-module Error (qcEither) where--import Test.QuickCheck (Result (Success))--qcEither :: Test.QuickCheck.Result -> Either String ()-qcEither = d where- d (Success {}) = Right ()- d x = Left $ show x
test/PrintParse.hs view
@@ -1,9 +1,9 @@ {-# OPTIONS -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} -module PrintParse (ppTests) where+module PrintParse (tests) where -import Distribution.TestSuite (Test)+import Distribution.TestSuite.Compat (prop, TestList, testList) import Test.QuickCheck (Gen, Arbitrary (..), choose, oneof, frequency, elements) @@ -18,9 +18,7 @@ import qualified Text.LDAP.Parser as Parser import Data.List.NonEmpty (NonEmpty ((:|))) -import Suite (suite) - list :: Gen a -> Int -> Gen [a] list g n = sequence [ g | _i <- [1..n] ] @@ -111,11 +109,12 @@ (Printer.openLdapEntry Printer.ldifEncodeAttrValue) (Parser.openLdapEntry Parser.ldifDecodeAttrValue) -ppTests :: [Test]-ppTests =- [ suite prop_attributeIso "attribute iso - print parse"- , suite prop_componentIso "component iso - print parse"- , suite prop_dnIso "dn iso - print parse"- , suite prop_ldifAttrIso "ldifAttr iso - print parse"- , suite prop_openLdapEntryIso "openLdapEntry iso - print parse"+tests :: TestList+tests =+ testList+ [ prop prop_attributeIso "attribute iso - print parse"+ , prop prop_componentIso "component iso - print parse"+ , prop prop_dnIso "dn iso - print parse"+ , prop prop_ldifAttrIso "ldifAttr iso - print parse"+ , prop prop_openLdapEntryIso "openLdapEntry iso - print parse" ]
− test114/Suite.hs
@@ -1,35 +0,0 @@-module Suite (suite) where--import Distribution.TestSuite- (TestOptions (..), Options (..), ImpureTestable (..), impure,- Test, Result (Pass, Fail, Error))-import qualified Distribution.TestSuite as TestSuite-import Test.QuickCheck (Testable, quickCheckResult)--import Control.Exception (try)-import Control.Applicative ((<$>))--import Error (qcEither)---test114 :: Testable prop => prop -> IO TestSuite.Result-test114 t = do- er <- try (qcEither <$> quickCheckResult t)- return $ case er of- Right (Right ()) -> Pass- Right (Left m) -> Fail m- Left e -> Error $ show (e :: IOError)--data Suite114 t = Suite114 String t--instance Testable prop => TestOptions (Suite114 prop) where- name (Suite114 n _) = n- options = const []- defaultOptions = const . return $ Options []- check _ _ = []--instance Testable prop => ImpureTestable (Suite114 prop) where- runM (Suite114 _ t) _ = test114 t--suite :: Testable prop => prop -> String -> Test-suite t n = impure $ Suite114 n t
− test114/Tests.hs
@@ -1,8 +0,0 @@-module Tests (tests) where--import Distribution.TestSuite (Test)--import PrintParse (ppTests)--tests :: [Test]-tests = ppTests
text-ldap.cabal view
@@ -1,6 +1,6 @@ name: text-ldap-version: 0.1.1.3+version: 0.1.1.4 synopsis: Parser and Printer for LDAP text data stream description: This package contains Parser and Printer for LDAP text data stream like OpenLDAP backup LDIF.@@ -52,11 +52,6 @@ ghc-options: -Wall -rtsopts ghc-prof-options: -prof -fprof-auto -flag test-cabal114- description: This flag make sense when Cabal 1.14 is used.- If true, use Cabal 1.14 test-suite interface.- default: False- Test-suite pp build-depends: base <5 , bytestring@@ -65,17 +60,11 @@ , text-ldap , QuickCheck >=2 , Cabal+ , cabal-test-compat type: detailed-0.9- test-module: Tests- other-modules:- Error- Suite- PrintParse- if flag(test-cabal114)- hs-source-dirs: test, test114- else- hs-source-dirs: test, test118+ test-module: PrintParse+ hs-source-dirs: test ghc-options: -Wall source-repository head