Hello community,

here is the log from the commit of package ghc-hspec-core for openSUSE:Factory 
checked in at 2018-10-25 08:16:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hspec-core (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-hspec-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-hspec-core"

Thu Oct 25 08:16:44 2018 rev:9 rq:642866 version:2.5.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-hspec-core/ghc-hspec-core.changes    
2018-07-24 17:19:50.359104142 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-hspec-core.new/ghc-hspec-core.changes       
2018-10-25 08:17:19.848044797 +0200
@@ -1,0 +2,6 @@
+Wed Oct 10 19:23:52 UTC 2018 - [email protected]
+
+- Update hspec-core to version 2.5.8.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------

Old:
----
  hspec-core-2.5.5.tar.gz

New:
----
  hspec-core-2.5.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-hspec-core.spec ++++++
--- /var/tmp/diff_new_pack.2sLoZi/_old  2018-10-25 08:17:20.384044563 +0200
+++ /var/tmp/diff_new_pack.2sLoZi/_new  2018-10-25 08:17:20.388044561 +0200
@@ -12,14 +12,14 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 %global pkg_name hspec-core
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        2.5.5
+Version:        2.5.8
 Release:        0
 Summary:        A Testing Framework for Haskell
 License:        MIT

++++++ hspec-core-2.5.5.tar.gz -> hspec-core-2.5.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hspec-core-2.5.5/hspec-core.cabal 
new/hspec-core-2.5.8/hspec-core.cabal
--- old/hspec-core-2.5.5/hspec-core.cabal       2018-07-16 22:34:21.000000000 
+0200
+++ new/hspec-core-2.5.8/hspec-core.cabal       2018-09-30 20:45:10.000000000 
+0200
@@ -1,13 +1,13 @@
-cabal-version: >= 1.10
+cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.29.5.
+-- This file has been generated from package.yaml by hpack version 0.30.0.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 18722f32fa5f70fec923fb16bae44075fdcc96cfab7622d6d9146d22fb7faed5
+-- hash: 2816c495eba299470f8178ab0162b41c33ff43fdd8c7d53ed3743386b018f184
 
 name:             hspec-core
-version:          2.5.5
+version:          2.5.8
 license:          MIT
 license-file:     LICENSE
 copyright:        (c) 2011-2018 Simon Hengel,
@@ -33,8 +33,8 @@
       vendor
   ghc-options: -Wall
   build-depends:
-      HUnit >=1.5.0.0
-    , QuickCheck >=2.10
+      HUnit ==1.6.*
+    , QuickCheck ==2.12.*
     , ansi-terminal >=0.5
     , array
     , base >=4.5.0.0 && <5
@@ -91,8 +91,8 @@
   ghc-options: -Wall
   cpp-options: -DTEST
   build-depends:
-      HUnit >=1.5.0.0
-    , QuickCheck >=2.10
+      HUnit ==1.6.*
+    , QuickCheck ==2.12.*
     , ansi-terminal >=0.5
     , array
     , base >=4.5.0.0 && <5
@@ -112,6 +112,8 @@
     , temporary
     , tf-random
     , transformers >=0.2.2.0
+  build-tool-depends:
+      hspec-meta:hspec-meta-discover
   other-modules:
       Test.Hspec.Core.Clock
       Test.Hspec.Core.Compat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hspec-core-2.5.5/src/Test/Hspec/Core/QuickCheck.hs 
new/hspec-core-2.5.8/src/Test/Hspec/Core/QuickCheck.hs
--- old/hspec-core-2.5.5/src/Test/Hspec/Core/QuickCheck.hs      2018-07-16 
22:34:21.000000000 +0200
+++ new/hspec-core-2.5.8/src/Test/Hspec/Core/QuickCheck.hs      2018-09-30 
20:45:10.000000000 +0200
@@ -1,9 +1,10 @@
 -- | Stability: provisional
 module Test.Hspec.Core.QuickCheck (
-  modifyMaxSuccess
+  modifyArgs
+, modifyMaxSuccess
 , modifyMaxDiscardRatio
 , modifyMaxSize
-
+, modifyMaxShrinks
 ) where
 
 import           Test.QuickCheck
@@ -30,6 +31,14 @@
     modify :: (Int -> Int) -> Args -> Args
     modify f args = args {maxSize = f (maxSize args)}
 
+-- | Use a modified `maxShrinks` for given spec.
+modifyMaxShrinks :: (Int -> Int) -> SpecWith a -> SpecWith a
+modifyMaxShrinks = modifyArgs . modify
+  where
+    modify :: (Int -> Int) -> Args -> Args
+    modify f args = args {maxShrinks = f (maxShrinks args)}
+
+-- | Use modified `Args` for given spec.
 modifyArgs :: (Args -> Args) -> SpecWith a -> SpecWith a
 modifyArgs = modifyParams . modify
   where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hspec-core-2.5.5/src/Test/Hspec/Core/QuickCheckUtil.hs 
new/hspec-core-2.5.8/src/Test/Hspec/Core/QuickCheckUtil.hs
--- old/hspec-core-2.5.5/src/Test/Hspec/Core/QuickCheckUtil.hs  2018-07-16 
22:34:21.000000000 +0200
+++ new/hspec-core-2.5.8/src/Test/Hspec/Core/QuickCheckUtil.hs  2018-09-30 
20:45:10.000000000 +0200
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
 {-# LANGUAGE RecordWildCards #-}
 module Test.Hspec.Core.QuickCheckUtil where
 
@@ -10,6 +9,7 @@
 import           Data.Maybe
 import           Data.Int
 import           System.Random
+
 import           Test.QuickCheck
 import           Test.QuickCheck.Text (isOneLine)
 import qualified Test.QuickCheck.Property as QCP
@@ -17,14 +17,11 @@
 import           Test.QuickCheck.Gen
 import           Test.QuickCheck.IO ()
 import           Test.QuickCheck.Random
+import qualified Test.QuickCheck.Test as QC (showTestCount)
+import           Test.QuickCheck.State (State(..))
 
 import           Test.Hspec.Core.Util
 
-import           Test.QuickCheck.Test (formatLabel)
-
-formatLabels :: Int -> [(String, Double)] -> String
-formatLabels n = unlines . map (formatLabel n True)
-
 aroundProperty :: ((a -> IO ()) -> IO ()) -> (a -> Property) -> Property
 aroundProperty action p = MkProperty . MkGen $ \r n -> aroundProp action $ \a 
-> (unGen . unProperty $ p a) r n
 
@@ -88,34 +85,49 @@
         | isOneLine reason = reason ++ " " ++ numbers ++ colonNewline
         | otherwise = numbers ++ colonNewline ++ ensureTrailingNewline reason
       numbers = formatNumbers numTests numShrinks
-#if MIN_VERSION_QuickCheck(2,11,0)
       colonNewline = ":\n"
-#else
-      colonNewline = ": \n"
-#endif
 
   GaveUp {..} ->
     case stripSuffix outputWithoutVerbose output of
-      Just info -> otherFailure info ("Gave up after " ++ pluralize numTests 
"test" ++ "!")
+      Just info -> otherFailure info ("Gave up after " ++ numbers ++ "!")
       Nothing -> couldNotParse output
     where
-      outputWithoutVerbose = "*** Gave up! Passed only " ++ pluralize numTests 
"test" ++ ".\n"
+      numbers = showTestCount numTests numDiscarded
+      outputWithoutVerbose = "*** Gave up! Passed only " ++ numbers ++ " 
tests.\n"
 
   NoExpectedFailure {..} -> case splitBy "*** Failed! " output of
     Just (info, err) -> otherFailure info err
     Nothing -> couldNotParse output
 
-  InsufficientCoverage {..} -> case splitBy ("*** " ++ pre) output of
-    Just (info, err) -> otherFailure info (pre ++ err)
-    Nothing -> couldNotParse output
-    where
-      pre = "Insufficient coverage after "
-
   where
     result = QuickCheckResult (numTests r) . strip
     otherFailure info err = result info (QuickCheckOtherFailure $ strip err)
     couldNotParse = result "" . QuickCheckOtherFailure
 
+showTestCount :: Int -> Int -> String
+showTestCount success discarded = QC.showTestCount state
+  where
+    state = MkState {
+      terminal                  = undefined
+    , maxSuccessTests           = undefined
+    , maxDiscardedRatio         = undefined
+    , coverageConfidence        = undefined
+    , computeSize               = undefined
+    , numTotMaxShrinks          = 0
+    , numSuccessTests           = success
+    , numDiscardedTests         = discarded
+    , numRecentlyDiscardedTests = 0
+    , labels                    = mempty
+    , classes                   = mempty
+    , tables                    = mempty
+    , requiredCoverage          = mempty
+    , expected                  = True
+    , randomSeed                = mkGen 0
+    , numSuccessShrinks         = 0
+    , numTryShrinks             = 0
+    , numTotTryShrinks          = 0
+    }
+
 ensureTrailingNewline :: String -> String
 ensureTrailingNewline = unlines . lines
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hspec-core-2.5.5/test/Test/Hspec/Core/Example/LocationSpec.hs 
new/hspec-core-2.5.8/test/Test/Hspec/Core/Example/LocationSpec.hs
--- old/hspec-core-2.5.5/test/Test/Hspec/Core/Example/LocationSpec.hs   
2018-07-16 22:34:21.000000000 +0200
+++ new/hspec-core-2.5.8/test/Test/Hspec/Core/Example/LocationSpec.hs   
2018-09-30 20:45:10.000000000 +0200
@@ -20,6 +20,7 @@
             return (n :: Int)
           extractLocation e `shouldBe` location
 
+#if !MIN_VERSION_base(4,12,0)
       context "in Either" $ do
         it "extracts Location" $ do
           let location = Just $ Location __FILE__ (__LINE__ + 4) 15
@@ -30,6 +31,7 @@
               return ()
           Left e <- try (evaluate foo)
           extractLocation e `shouldBe` location
+#endif
 
     context "with ErrorCall" $ do
       it "extracts Location" $ do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hspec-core-2.5.5/test/Test/Hspec/Core/QuickCheckUtilSpec.hs 
new/hspec-core-2.5.8/test/Test/Hspec/Core/QuickCheckUtilSpec.hs
--- old/hspec-core-2.5.5/test/Test/Hspec/Core/QuickCheckUtilSpec.hs     
2018-07-16 22:34:21.000000000 +0200
+++ new/hspec-core-2.5.8/test/Test/Hspec/Core/QuickCheckUtilSpec.hs     
2018-09-30 20:45:10.000000000 +0200
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
 {-# LANGUAGE StandaloneDeriving #-}
 {-# OPTIONS_GHC -fno-warn-orphans #-}
@@ -60,7 +59,7 @@
           p n = (n == 1234) ==> True
 
           qc = quickCheckWithResult args {maxSuccess = 2, maxDiscardRatio = 1}
-          result = QuickCheckResult 0 "" (QuickCheckOtherFailure "Gave up 
after 0 tests!")
+          result = QuickCheckResult 0 "" (QuickCheckOtherFailure "Gave up 
after 0 tests; 2 discarded!")
 
       it "parses result" $ do
         parseQuickCheckResult <$> qc p `shouldReturn` result
@@ -97,26 +96,57 @@
         parseQuickCheckResult <$> quickCheckWithResult args {maxSuccess = 2} 
(verbose p) `shouldReturn`
           QuickCheckResult 2 info (QuickCheckOtherFailure "Passed 2 tests 
(expected failure).")
 
-    context "with InsufficientCoverage" $ do
-      let
-        p :: Int -> Property
-        p n = cover (n == 23) 10 "is 23" True
+    context "with cover" $ do
+      context "without checkCoverage" $ do
+        let
+          p :: Int -> Property
+          p n = cover 10 (n == 23) "is 23" True
 
-      it "parses result" $ do
-        parseQuickCheckResult <$> qc p `shouldReturn`
-          QuickCheckResult 100 "" (QuickCheckOtherFailure "Insufficient 
coverage after 100 tests (only 0% is 23, not 10%).")
+        it "parses result" $ do
+          parseQuickCheckResult <$> qc p `shouldReturn`
+            QuickCheckResult 100 "+++ OK, passed 100 tests.\n\nOnly 0% is 23, 
but expected 10%" QuickCheckSuccess
 
-      it "includes verbose output" $ do
+        it "includes verbose output" $ do
+          let
+            info = intercalate "\n" [
+                "Passed:"
+              , "0"
+              , ""
+              , "Passed:"
+              , "-39"
+              , ""
+              , "+++ OK, passed 2 tests."
+              , ""
+              , "Only 0% is 23, but expected 10%"
+              ]
+          parseQuickCheckResult <$> quickCheckWithResult args {maxSuccess = 2} 
(verbose p) `shouldReturn`
+            QuickCheckResult 2 info QuickCheckSuccess
+
+      context "with checkCoverage" $ do
         let
-          info = intercalate "\n" [
-              "Passed:"
-            , "0"
-            , ""
-            , "Passed:"
-            , "-39"
-            ]
-        parseQuickCheckResult <$> quickCheckWithResult args {maxSuccess = 2} 
(verbose p) `shouldReturn`
-          QuickCheckResult 2 info (QuickCheckOtherFailure "Insufficient 
coverage after 2 tests (only 0% is 23, not 10%).")
+          p :: Int -> Property
+          p n = checkCoverage $ cover 10 (n == 23) "is 23" True
+
+          failure :: QuickCheckFailure
+          failure = QCFailure {
+              quickCheckFailureNumShrinks = 0
+            , quickCheckFailureException = Nothing
+            , quickCheckFailureReason = "Insufficient coverage"
+            , quickCheckFailureCounterexample = [
+                " 1.0% is 23"
+              , ""
+              , "Only 1.0% is 23, but expected 10.0%"
+              ]
+            }
+
+        it "parses result" $ do
+          parseQuickCheckResult <$> qc p `shouldReturn`
+            QuickCheckResult 800 "" (QuickCheckFailure failure)
+
+        it "includes verbose output" $ do
+          let info = intercalate "\n\n" (replicate 799 "Passed:")
+          parseQuickCheckResult <$> qc (verbose . p) `shouldReturn`
+            QuickCheckResult 800 info (QuickCheckFailure failure)
 
     context "with Failure" $ do
       context "with single-line failure reason" $ do
@@ -138,11 +168,7 @@
                 , "Failed:"
                 , "1"
                 , ""
-#if MIN_VERSION_QuickCheck(2,11,0)
                 , "Passed:"
-#else
-                , "*** Failed! Passed:"
-#endif
                 , "0"
                 ]
 
@@ -167,11 +193,7 @@
                 , "Failed:"
                 , "1"
                 , ""
-#if MIN_VERSION_QuickCheck(2,11,0)
                 , "Passed:"
-#else
-                , "*** Failed! Passed:"
-#endif
                 , "0"
                 ]
           parseQuickCheckResult <$> qc (verbose p) `shouldReturn` result 
{quickCheckResultInfo = info}


Reply via email to