packages feed

sql-words 0.1.3.0 → 0.1.3.1

raw patch · 3 files changed

+61/−58 lines, 3 filesdep +quickcheck-simpledep −Cabaldep −cabal-test-compatPVP ok

version bump matches the API change (PVP)

Dependencies added: quickcheck-simple

Dependencies removed: Cabal, cabal-test-compat

API changes (from Hackage documentation)

Files

sql-words.cabal view
@@ -1,5 +1,5 @@ name:                sql-words-version:             0.1.3.0+version:             0.1.3.1 synopsis:            Simple idea SQL keywords data constructor into OverloadedString description:         This package contiains SQL keywords constructors defined as                      OverloadedString literals and helper functions to concate these.@@ -30,13 +30,12 @@  test-suite monoids   build-depends:         base <5-                       , Cabal-                       , cabal-test-compat+                       , quickcheck-simple                        , QuickCheck >=2                        , sql-words -  type:                detailed-0.9-  test-module:         MonoidLaw+  type:                exitcode-stdio-1.0+  main-is:             monoidLaw.hs    hs-source-dirs:      test   ghc-options:         -Wall
− test/MonoidLaw.hs
@@ -1,53 +0,0 @@-{-# OPTIONS -fno-warn-orphans #-}--module MonoidLaw (tests) where--import Language.SQL.Keyword (Keyword, DString)--import Data.Monoid (Monoid, mempty, (<>))-import Data.String (fromString)-import Distribution.TestSuite.Compat (TestList, testList, prop)-import Test.QuickCheck (Arbitrary (..))---leftId :: (Eq a, Monoid a) => a -> Bool-leftId a = mempty <> a == a--rightId :: (Eq a, Monoid a) => a -> Bool-rightId a = a <> mempty == a--assoc :: (Eq a, Monoid a) => a -> a -> a -> Bool-assoc a b c = (a <> b) <> c == a <> (b <> c)--dsLeftId :: DString -> Bool-dsLeftId =  leftId--dsRightId :: DString -> Bool-dsRightId =  rightId--dsAssoc :: DString -> DString -> DString -> Bool-dsAssoc =  assoc--instance Arbitrary DString where-  arbitrary = fmap read arbitrary--kwLeftId :: Keyword -> Bool-kwLeftId =  leftId--kwRightId :: Keyword -> Bool-kwRightId =  rightId--kwAssoc :: Keyword -> Keyword -> Keyword -> Bool-kwAssoc =  assoc--instance Arbitrary Keyword where-  arbitrary = fmap fromString arbitrary--tests :: TestList-tests =  testList [ prop "DString left Id"  dsLeftId-                  , prop "DString right Id" dsRightId-                  , prop "DString associativity" dsAssoc-                  , prop "Keyword left Id"  kwLeftId-                  , prop "Keyword right Id" kwRightId-                  , prop "Keyword associativity" kwAssoc-                  ]
+ test/monoidLaw.hs view
@@ -0,0 +1,57 @@+{-# OPTIONS -fno-warn-orphans #-}++import Language.SQL.Keyword (Keyword, DString)++import Data.Monoid (Monoid, mempty, (<>))+import Data.String (fromString)+import Test.QuickCheck (Arbitrary (..), Testable)+import Test.QuickCheck.Simple (Test, qcTest, defaultMain)+++prop :: Testable prop => String -> prop -> Test+prop = qcTest++leftId :: (Eq a, Monoid a) => a -> Bool+leftId a = mempty <> a == a++rightId :: (Eq a, Monoid a) => a -> Bool+rightId a = a <> mempty == a++assoc :: (Eq a, Monoid a) => a -> a -> a -> Bool+assoc a b c = (a <> b) <> c == a <> (b <> c)++dsLeftId :: DString -> Bool+dsLeftId =  leftId++dsRightId :: DString -> Bool+dsRightId =  rightId++dsAssoc :: DString -> DString -> DString -> Bool+dsAssoc =  assoc++instance Arbitrary DString where+  arbitrary = fmap read arbitrary++kwLeftId :: Keyword -> Bool+kwLeftId =  leftId++kwRightId :: Keyword -> Bool+kwRightId =  rightId++kwAssoc :: Keyword -> Keyword -> Keyword -> Bool+kwAssoc =  assoc++instance Arbitrary Keyword where+  arbitrary = fmap fromString arbitrary++tests :: [Test]+tests =  [ prop "DString left Id"  dsLeftId+         , prop "DString right Id" dsRightId+         , prop "DString associativity" dsAssoc+         , prop "Keyword left Id"  kwLeftId+         , prop "Keyword right Id" kwRightId+         , prop "Keyword associativity" kwAssoc+         ]++main :: IO ()+main = defaultMain tests