packages feed

quickpull 0.2.0.0 → 0.4.0.0

raw patch · 11 files changed

+173/−195 lines, 11 filesdep +barecheckdep ~QuickCheck

Dependencies added: barecheck

Dependency ranges changed: QuickCheck

Files

+ bin/quickpull-main.hs view
@@ -0,0 +1,33 @@+module Main where++import Control.Monad+import System.Environment+import System.Exit+import Quickpull.Files+import Quickpull.Render++help+  :: String+  -- ^ Program name+  -> String++help pn = unlines+  [ "usage: " ++ pn ++ " DIRECTORY..."+  , "Finds each Haskell module in each given directory."+  , "Prints to standard output a module containing a list"+  , "of all QuickCheck properties in each module."+  ]++runnerModuleName :: String+runnerModuleName = "Decrees"++main :: IO ()+main = do+  as <- getArgs+  pn <- getProgName+  when (as == ["-h"] || as == ["--help"]) $ do+    putStr $ help pn+    exitSuccess+  mds <- fmap concat . mapM allModules $ as+  ps <- fmap concat . mapM readAndParse $ mds+  putStr $ testModule runnerModuleName ps
− bin/quickpull.hs
@@ -1,33 +0,0 @@-module Main where--import Control.Monad-import System.Environment-import System.Exit-import Quickpull.Files-import Quickpull.Render--help-  :: String-  -- ^ Program name-  -> String--help pn = unlines-  [ "usage: " ++ pn ++ " DIRECTORY..."-  , "Finds each Haskell module in each given directory."-  , "Prints to standard output a module containing a list"-  , "of all QuickCheck properties in each module."-  ]--runnerModuleName :: String-runnerModuleName = "Decrees"--main :: IO ()-main = do-  as <- getArgs-  pn <- getProgName-  when (as == ["-h"] || as == ["--help"]) $ do-    putStr $ help pn-    exitSuccess-  mds <- fmap concat . mapM allModules $ as-  ps <- fmap concat . mapM readAndParse $ mds-  putStr $ testModule runnerModuleName ps
− current-versions.txt
@@ -1,42 +0,0 @@-This package was tested to work with these dependency-versions and compiler version.-These are the default versions fetched by cabal install.-Tested as of: 2014-07-13 15:07:50.828612 UTC-Path to compiler: ghc-7.8.2-Compiler description: 7.8.2--/opt/ghc/7.8.2/lib/ghc-7.8.2/package.conf.d:-    Cabal-1.18.1.3-    array-0.5.0.0-    base-4.7.0.0-    bin-package-db-0.0.0.0-    binary-0.7.1.0-    rts-1.0-    bytestring-0.10.4.0-    containers-0.5.5.1-    deepseq-1.3.0.2-    directory-1.2.1.0-    filepath-1.3.0.2-    (ghc-7.8.2)-    ghc-prim-0.3.1.0-    (haskell2010-1.1.2.0)-    (haskell98-2.0.0.3)-    hoopl-3.10.0.1-    hpc-0.6.0.1-    integer-gmp-0.5.1.0-    old-locale-1.0.0.6-    old-time-1.1.0.2-    pretty-1.1.1.1-    process-1.2.0.0-    template-haskell-2.9.0.0-    time-1.4.2-    transformers-0.3.0.0-    unix-2.7.0.1--/home/massysett/quickpull/sunlight-922/db:-    QuickCheck-2.7.5-    primitive-0.5.3.0-    quickpull-0.2.0.0-    random-1.0.1.1-    tf-random-0.5-
genCabal.hs view
@@ -6,7 +6,7 @@ import qualified Cartel as C  version :: [Int]-version = [0,2,0,0]+version = [0,4,0,0]  -- Dependencies are intended to work with GHC 7.4.1.  Versions that -- came with GHC 7.4.1:@@ -14,8 +14,8 @@ -- directory-1.1.0.2 -- filepath-1.3.0.0 --- Versions that came with GHC 7.8.2:--- base-4.7.0.0+-- Versions that came with GHC 7.8.3:+-- base-4.7.0.1 -- directory-1.2.1.0 -- filepath-1.3.0.2 @@ -35,14 +35,29 @@ filepath :: C.Package filepath = C.closedOpen "filepath" [1,3,0,0] [1,4] -depends :: [C.Package]-depends =-  [ base-  , quickcheck-  , directory-  , filepath+barecheck :: C.Package+barecheck = C.closedOpen "barecheck" [0,2,0,6] [0,3]++commonOptions :: C.Field a => [a]+commonOptions =+  [ C.buildDepends+    [ base+    , directory+    , filepath+    ]+  , C.cif (C.flag "old-quick-check")+    [ C.buildDepends [C.Package "QuickCheck" (Just (C.lt [2,7]))]+    , C.hsSourceDirs ["quickcheck-old"]+    ]+    [ C.buildDepends [ C.closedOpen "QuickCheck" [2,7] [2,8] ]+    , C.hsSourceDirs ["quickcheck-new"]+    ]+  , C.hsSourceDirs ["lib"]+  , C.ghcOptions ghcOptions+  , C.defaultLanguage C.Haskell2010   ] + properties :: C.Properties properties = C.empty   { C.prName = "quickpull"@@ -63,10 +78,10 @@     , "\"Quickpull\" module."     ]   , C.prExtraSourceFiles =-    [ "current-versions.txt"-    , "minimum-versions.txt"-    , "genCabal.hs"+    [ "genCabal.hs"     , "README.md"+    , "quickcheck-new/Quickpull/EqShow.hs"+    , "quickcheck-old/Quickpull/EqShow.hs"     ]   } @@ -77,33 +92,23 @@   :: [String]   -- ^ Library modules   -> C.Library-library ms = C.Library-  [ C.buildDepends depends-  , C.defaultLanguage C.Haskell2010-  , C.hsSourceDirs ["lib"]-  , C.ghcOptions ghcOptions-  , C.LibExposedModules ms+library ms = C.Library $ commonOptions +++  [ C.LibExposedModules ms   ]  testSuite :: C.TestSuite-testSuite = C.TestSuite "quickpull-tests"+testSuite = C.TestSuite "quickpull-tests" $ commonOptions ++   [ C.TestType C.ExitcodeStdio   , C.TestMainIs "quickpull-tests.hs"-  , C.buildDepends depends   , C.otherModules ["Decrees", "Tests"]-  , C.ghcOptions ghcOptions-  , C.hsSourceDirs ["lib", "tests"]-  , C.defaultLanguage C.Haskell2010+  , C.hsSourceDirs ["tests"]   ]   executable :: C.Executable-executable = C.Executable "quickpull"-  [ C.buildDepends depends-  , C.defaultLanguage C.Haskell2010-  , C.hsSourceDirs ["lib", "bin"]-  , C.ExeMainIs "quickpull.hs"-  , C.ghcOptions ghcOptions+executable = C.Executable "quickpull" $ commonOptions +++  [ C.hsSourceDirs ["bin"]+  , C.ExeMainIs "quickpull-main.hs"   ]  -- This tests the Gen monad of QuickCheck.  Not included in the@@ -111,13 +116,12 @@ exeTestGen :: C.Executable exeTestGen = C.Executable "quickpull-test-gen"   [ C.cif (C.flag "build-test-gen")-    [ C.buildDepends depends ]+    commonOptions     [ C.buildable False ]-  , C.defaultLanguage C.Haskell2010+  , C.buildDepends [ barecheck ]   , C.ExeMainIs "quickpull-test-gen.hs"-  , C.hsSourceDirs ["lib", "quickcheck-tests"]+  , C.hsSourceDirs ["quickcheck-tests"]   , C.otherModules ["Decrees", "Tests"]-  , C.ghcOptions ghcOptions   ]  flagTestGen :: C.Flag@@ -128,6 +132,14 @@   , C.flManual = True   } +flagOldQuickCheck :: C.Flag+flagOldQuickCheck = C.empty+  { C.flName = "old-quick-check"+  , C.flDescription = "Use version of QuickCheck before version 2.7"+  , C.flDefault = False+  , C.flManual = False+  }+ repo :: C.Repository repo = C.empty   { C.repoVcs = C.Git@@ -142,7 +154,7 @@   , C.cLibrary = Just $ library ms   , C.cExecutables = [ executable, exeTestGen ]   , C.cTestSuites = [testSuite]-  , C.cFlags = [ flagTestGen ]+  , C.cFlags = [ flagTestGen, flagOldQuickCheck ]   }  main :: IO ()
− lib/Quickpull/Function.hs
@@ -1,16 +0,0 @@--- | Helpers to generate random functions.-module Quickpull.Function where--import Test.QuickCheck-import Test.QuickCheck.Gen.Unsafe---- | Generate a random function.  This is simply a duplicate of what's--- in the QuickCheck 'Arbitrary' instance for functions; having it--- here saves you from having to define 'Arbitrary' and 'CoArbitrary'--- instances for your types (which can require either orphan instances--- or a lot of annoying wrapping and unwrapping.)-function-  :: (a -> Gen b -> Gen b)-  -> Gen b-  -> Gen (a -> b)-function perturb gen = promote (`perturb` gen)
lib/Quickpull/Laws.hs view
@@ -10,6 +10,8 @@ import Data.Monoid import Quickpull.Types import Test.QuickCheck+  ( Gen, arbitrary, listOf, Property )+import Quickpull.EqShow ((===))  -- | Tests the monad laws: --
− minimum-versions.txt
@@ -1,42 +0,0 @@-This package was tested to work with these dependency-versions and compiler version.-These are the minimum versions given in the .cabal file.-Tested as of: 2014-07-13 15:07:50.828612 UTC-Path to compiler: ghc-7.4.1-Compiler description: 7.4.1--/opt/ghc/7.4.1/lib/ghc-7.4.1/package.conf.d:-    Cabal-1.14.0-    array-0.4.0.0-    base-4.5.0.0-    bin-package-db-0.0.0.0-    binary-0.5.1.0-    bytestring-0.9.2.1-    containers-0.4.2.1-    deepseq-1.3.0.0-    directory-1.1.0.2-    extensible-exceptions-0.1.1.4-    filepath-1.3.0.0-    (ghc-7.4.1)-    ghc-prim-0.2.0.0-    (haskell2010-1.1.0.1)-    (haskell98-2.0.0.1)-    hoopl-3.8.7.3-    hpc-0.5.1.1-    integer-gmp-0.4.0.0-    old-locale-1.0.0.4-    old-time-1.1.0.0-    pretty-1.1.1.0-    process-1.1.0.1-    rts-1.0-    template-haskell-2.7.0.0-    time-1.4-    unix-2.5.1.0--/home/massysett/quickpull/sunlight-922/db:-    QuickCheck-2.7.2-    primitive-0.5.3.0-    quickpull-0.2.0.0-    random-1.0.1.1-    tf-random-0.5-
+ quickcheck-new/Quickpull/EqShow.hs view
@@ -0,0 +1,6 @@+-- | This module is necessary to maintain compatibility with both+-- QuickCheck 2.6 and QuickCheck 2.7.  This module is used for newer+-- versions of QuickCheck (after version 2.7).+module Quickpull.EqShow ((===)) where++import Test.QuickCheck
+ quickcheck-old/Quickpull/EqShow.hs view
@@ -0,0 +1,13 @@+-- | This module is necessary to maintain compatibility with both+-- QuickCheck 2.6 and QuickCheck 2.7.  This module is used for older+-- versions of QuickCheck (before version 2.7).+module Quickpull.EqShow ((===)) where++import Test.QuickCheck++infix 4 ===++-- | Like '==', but prints a counterexample when it fails.+(===) :: (Eq a, Show a) => a -> a -> Property+x === y =+  printTestCase (show x ++ " /= " ++ show y) (x == y)
quickcheck-tests/Tests.hs view
@@ -12,14 +12,14 @@ module Tests where  import Quickpull-import Quickpull.Function import Quickpull.Laws import Test.QuickCheck import Test.QuickCheck.Gen+import Prelude.Generators (function1)  genGen :: Gen (Gen Int) genGen = do-  f <- function coarbitraryShow arbitrary+  f <- function1 coarbitraryShow arbitrary   return $ MkGen (curry f)  genFGen :: Gen (Int -> Gen Int)
quickpull.cabal view
@@ -3,10 +3,10 @@ -- http://www.github.com/massysett/cartel -- -- Script name used to generate: genCabal.hs--- Generated on: 2014-07-13 11:14:43.265661 EDT+-- Generated on: 2014-12-01 21:23:04.92058 EST -- Cartel library version: 0.10.0.2 name: quickpull-version: 0.2.0.0+version: 0.4.0.0 cabal-version: >= 1.14 build-type: Simple license: BSD3@@ -25,10 +25,10 @@   "Quickpull" module. category: Testing extra-source-files:-    current-versions.txt-  , minimum-versions.txt-  , genCabal.hs+    genCabal.hs   , README.md+  , quickcheck-new/Quickpull/EqShow.hs+  , quickcheck-old/Quickpull/EqShow.hs  source-repository head   type: git@@ -39,22 +39,35 @@   Default: False   Manual: True +Flag old-quick-check+  Description: Use version of QuickCheck before version 2.7+  Default: False+  Manual: False+ Library   build-depends:       base ((> 4.5.0.0 || == 4.5.0.0) && < 4.8)-    , QuickCheck ((> 2.7.2 || == 2.7.2) && < 2.8)     , directory ((> 1.1.0.2 || == 1.1.0.2) && < 1.3)     , filepath ((> 1.3.0.0 || == 1.3.0.0) && < 1.4)-  default-language: Haskell2010+  if flag(old-quick-check)+    build-depends:+        QuickCheck < 2.7+    hs-source-dirs:+        quickcheck-old+  else+    build-depends:+        QuickCheck ((> 2.7 || == 2.7) && < 2.8)+    hs-source-dirs:+        quickcheck-new   hs-source-dirs:       lib   ghc-options:       -Wall+  default-language: Haskell2010   exposed-modules:       Quickpull     , Quickpull.Files     , Quickpull.Formatting-    , Quickpull.Function     , Quickpull.Laws     , Quickpull.Render     , Quickpull.Runners@@ -63,51 +76,83 @@ Executable quickpull   build-depends:       base ((> 4.5.0.0 || == 4.5.0.0) && < 4.8)-    , QuickCheck ((> 2.7.2 || == 2.7.2) && < 2.8)     , directory ((> 1.1.0.2 || == 1.1.0.2) && < 1.3)     , filepath ((> 1.3.0.0 || == 1.3.0.0) && < 1.4)-  default-language: Haskell2010+  if flag(old-quick-check)+    build-depends:+        QuickCheck < 2.7+    hs-source-dirs:+        quickcheck-old+  else+    build-depends:+        QuickCheck ((> 2.7 || == 2.7) && < 2.8)+    hs-source-dirs:+        quickcheck-new   hs-source-dirs:       lib-    , bin-  main-is: quickpull.hs   ghc-options:       -Wall+  default-language: Haskell2010+  hs-source-dirs:+      bin+  main-is: quickpull-main.hs  Executable quickpull-test-gen   if flag(build-test-gen)     build-depends:         base ((> 4.5.0.0 || == 4.5.0.0) && < 4.8)-      , QuickCheck ((> 2.7.2 || == 2.7.2) && < 2.8)       , directory ((> 1.1.0.2 || == 1.1.0.2) && < 1.3)       , filepath ((> 1.3.0.0 || == 1.3.0.0) && < 1.4)+    if flag(old-quick-check)+      build-depends:+          QuickCheck < 2.7+      hs-source-dirs:+          quickcheck-old+    else+      build-depends:+          QuickCheck ((> 2.7 || == 2.7) && < 2.8)+      hs-source-dirs:+          quickcheck-new+    hs-source-dirs:+        lib+    ghc-options:+        -Wall+    default-language: Haskell2010   else     buildable: False-  default-language: Haskell2010+  build-depends:+      barecheck ((> 0.2.0.6 || == 0.2.0.6) && < 0.3)   main-is: quickpull-test-gen.hs   hs-source-dirs:-      lib-    , quickcheck-tests+      quickcheck-tests   other-modules:       Decrees     , Tests-  ghc-options:-      -Wall  Test-Suite quickpull-tests-  type: exitcode-stdio-1.0-  main-is: quickpull-tests.hs   build-depends:       base ((> 4.5.0.0 || == 4.5.0.0) && < 4.8)-    , QuickCheck ((> 2.7.2 || == 2.7.2) && < 2.8)     , directory ((> 1.1.0.2 || == 1.1.0.2) && < 1.3)     , filepath ((> 1.3.0.0 || == 1.3.0.0) && < 1.4)+  if flag(old-quick-check)+    build-depends:+        QuickCheck < 2.7+    hs-source-dirs:+        quickcheck-old+  else+    build-depends:+        QuickCheck ((> 2.7 || == 2.7) && < 2.8)+    hs-source-dirs:+        quickcheck-new+  hs-source-dirs:+      lib+  ghc-options:+      -Wall+  default-language: Haskell2010+  type: exitcode-stdio-1.0+  main-is: quickpull-tests.hs   other-modules:       Decrees     , Tests-  ghc-options:-      -Wall   hs-source-dirs:-      lib-    , tests-  default-language: Haskell2010+      tests