packages feed

easytest 0.1 → 0.1.1

raw patch · 4 files changed

+42/−7 lines, 4 filesdep +call-stackdep +semigroupsdep +transformersdep ~asyncdep ~basePVP ok

version bump matches the API change (PVP)

Dependencies added: call-stack, semigroups, transformers

Dependency ranges changed: async, base

API changes (from Hackage documentation)

Files

+ CHANGES.md view
@@ -0,0 +1,9 @@+## 0.1.1 (3/25/2018)++* [Add ghc 7.10.3 compatibility.](https://github.com/joelburget/easytest/commit/4acfad507cefc3fb2c0d588f1fbe0e4d583a762d)+* [allow async 2.2, ghc 8.4 compatibility](https://github.com/joelburget/easytest/commit/6c20c18988dd756d8088c9d0318b597be15c9229)+* [build with latest stackage nightly](https://github.com/joelburget/easytest/commit/2ea7f7520b39ac74b576414e4e1df75f596ed7b4)++## 0.1 (3/6/2018)++Initial release.
easytest.cabal view
@@ -1,6 +1,6 @@ name:          easytest category:      Testing-version:       0.1+version:       0.1.1 license:       MIT cabal-version: >= 1.8 license-file:  LICENSE@@ -53,9 +53,9 @@   The idea here is to write tests with ordinary Haskell code, with control flow explicit and under programmer control.  build-type:    Simple-extra-source-files:+extra-source-files: CHANGES.md data-files:-tested-with: GHC == 8.0.2, GHC == 8.2.1+tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.1, GHC == 8.4.1  source-repository head   type: git@@ -83,13 +83,18 @@    -- these bounds could probably be made looser   build-depends:-    async                     >= 2.1      && <= 2.2,+    async                     >= 2.1      && <= 2.3,     base                      >= 4.5      && <= 5,     mtl                       >= 2.0.1    && < 2.3,     containers                >= 0.4.0    && < 0.6,     stm                       >= 2.4      && < 3,     random                    >= 1.1      && < 2,-    text                      >= 1.2      && < 1.3+    text                      >= 1.2      && < 1.3,+    transformers              >= 0.4.2,+    call-stack                >= 0.1++  if !impl(ghc >= 8.0)+    build-depends: semigroups == 0.18.*    ghc-options: -Wall -fno-warn-name-shadowing 
src/EasyTest/Internal.hs view
@@ -1,4 +1,6 @@ {-# language BangPatterns #-}+{-# language CPP #-}+{-# language FlexibleContexts #-} {-# language FlexibleInstances #-} {-# language MultiParamTypeClasses #-} {-# language NamedFieldPuns #-}@@ -27,11 +29,17 @@ import Control.Monad.IO.Class import Control.Monad.Reader import Data.List (isPrefixOf)+#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup+#endif import Data.String (IsString(..)) import Data.Text (Text) import qualified Data.Text as T+#if MIN_VERSION_base(4,9,0) import GHC.Stack+#else+import Data.CallStack+#endif import qualified System.Random as Random  -- | Status of a test@@ -49,7 +57,10 @@  instance Monoid Status where   mempty  = Passed 0+#if !MIN_VERSION_base(4,11,0)+  -- This is redudant starting with base-4.11 / GHC 8.4.   mappend = combineStatus+#endif  data Env =   Env { envRng :: TVar Random.StdGen@@ -76,6 +87,11 @@ -- -- Using any or all of these capabilities, you assemble 'Test' values into a "test suite" (just another 'Test' value) using ordinary Haskell code, not framework magic. Notice that to generate a list of random values, we just 'replicateM' and 'forM' as usual. newtype Test a = Test (ReaderT Env IO (Maybe a))++#if !MIN_VERSION_base(4,9,0)+prettyCallStack :: CallStack -> String+prettyCallStack = show+#endif  -- | Record a failure at the current scope crash :: HasCallStack => Text -> Test a
src/EasyTest/Porcelain.hs view
@@ -1,5 +1,8 @@-{-# language OverloadedStrings #-} {-# language BangPatterns #-}+{-# language CPP #-}+{-# language FlexibleContexts #-}+{-# language OverloadedStrings #-}+ module EasyTest.Porcelain   ( -- * Tests     Test@@ -31,11 +34,13 @@ import Control.Monad import Control.Monad.IO.Class import Control.Monad.Reader+#if !(MIN_VERSION_base(4,11,0)) import Data.Semigroup+#endif import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T-import GHC.Stack+import Data.CallStack import System.Exit import qualified Control.Concurrent.Async as A import qualified Data.Map as Map