packages feed

test-simple 0.1.6 → 0.1.7

raw patch · 4 files changed

+19/−10 lines, 4 filesdep ~QuickCheckdep ~state-plus

Dependency ranges changed: QuickCheck, state-plus

Files

+ changelog view
@@ -0,0 +1,3 @@+0.1.7+------+* Compatibility with QuickCheck 2.7
src/Test/Simple.hs view
@@ -70,6 +70,7 @@ import qualified Test.QuickCheck.Test as Q import Test.QuickCheck.Property (Result(reason), succeeded, failed) import Test.QuickCheck.Monadic+import Control.Applicative  -- | Is used in 'like', 'unlike' tests. class Likeable a b where@@ -86,7 +87,7 @@ -- | Test.Simple is implemented as monad transformer. newtype TestSimpleT m a = MkTST { unTST :: StatePlusT TSState m a }                                 deriving (Functor, MonadTrans, Monad, MonadPlus-                                            , MonadState TSState, MonadIO)+                                            , MonadState TSState, MonadIO, Alternative, Applicative)  emptyState :: TSState emptyState = TSS 0 0 0 Nothing []@@ -216,9 +217,9 @@     e = TH.loc_end l  instance Testable (TestSimpleT Gen a) where-    property m = do+    property m = property $ do         (b, lns) <- runTestSimple m-        property $ if b then succeeded else failed { reason = intercalate "\n" lns }+        return $ if b then succeeded else failed { reason = intercalate "\n" lns }  instance Testable (TestSimpleT (PropertyM IO) a) where     property m = monadicIO $ do
test-simple.cabal view
@@ -1,8 +1,8 @@ Name:                test-simple-Version:             0.1.6+Version:             0.1.7 License:             BSD3 License-File:        COPYING-Copyright:           Boris Sukholitko, 2012+Copyright:           Boris Sukholitko, 2014 Author:              Boris Sukholitko Maintainer:          boriss@gmail.com Cabal-version:       >= 1.8@@ -12,10 +12,14 @@ Description:     Test.Simple provides simple, Perl inspired primitives for easy testing. It outputs test     results in TAP format.+Extra-Source-Files:  changelog+Source-Repository head+    Type: git+    Location: https://github.com/bosu/test-simple  library -  build-depends:  base < 5, mtl, template-haskell, state-plus-                    , QuickCheck > 2.4 && < 2.7+  build-depends:  base < 5, mtl, template-haskell, state-plus >= 0.1.1 && < 0.2+                    , QuickCheck >= 2.7.6 && < 2.8   hs-source-dirs:   src   ghc-options:      -Wall   exposed-modules:  Test.Simple@@ -23,7 +27,7 @@ test-suite Main   type:            exitcode-stdio-1.0   build-depends:   base < 5, test-simple, process, executable-path, mtl-                    , QuickCheck > 2.4 && < 2.7+                    , QuickCheck >= 2.7.6 && < 2.8   ghc-options:     -Wall   hs-source-dirs:  tests   main-is:         Main.hs
tests/Main.hs view
@@ -102,7 +102,8 @@ testQCFail ec out _ = do     isnt ec ExitSuccess     like out "not ok 2"-    like out "Failed! 1..2"+    like out "Failed!"+    like out "1..2"     like out "# Foo: False at unknown location."  testPropFail :: ExitCode -> String -> String -> TestSimpleT IO Bool@@ -113,7 +114,7 @@  testAll :: IO () testAll = testSimpleMain $ do-    plan 58+    plan 59     pn <- liftIO getExecutablePath     mapM_ (runMyself pn) [ ("bbbf", testUnknown), ("ok1", testOk1), ("nok1", testNOk1)                 , ("mism", testMismatch), ("isf", testIsFailure)