Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-tasty-quickcheck for
openSUSE:Factory checked in at 2025-01-27 20:51:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-tasty-quickcheck (Old)
and /work/SRC/openSUSE:Factory/.ghc-tasty-quickcheck.new.2316 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-tasty-quickcheck"
Mon Jan 27 20:51:42 2025 rev:9 rq:1239829 version:0.11.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-tasty-quickcheck/ghc-tasty-quickcheck.changes
2024-12-20 23:11:54.867673504 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-tasty-quickcheck.new.2316/ghc-tasty-quickcheck.changes
2025-01-27 20:51:54.830370232 +0100
@@ -1,0 +2,16 @@
+Mon Jan 6 23:44:29 UTC 2025 - Peter Simons <[email protected]>
+
+- Update tasty-quickcheck to version 0.11.1 revision 1.
+ Version 0.11.1
+ --------------
+
+ * Add timeouts for individual tests within a property
+ ([#425](https://github.com/UnkindPartition/tasty/pull/425)).
+ * Define `showDefaultValue` for `QuickCheckTests`,
+ `QuickCheckMaxSize` and `QuickCheckMaxRatio`
+ ([#428](https://github.com/UnkindPartition/tasty/pull/428)).
+ * Print the number of QuickCheck shrinks in the progress message
+ ([#431](https://github.com/UnkindPartition/tasty/pull/431)).
+ * Drop support for GHC 7.10.
+
+-------------------------------------------------------------------
Old:
----
tasty-quickcheck-0.11.tar.gz
New:
----
tasty-quickcheck-0.11.1.tar.gz
tasty-quickcheck.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-tasty-quickcheck.spec ++++++
--- /var/tmp/diff_new_pack.w589Ow/_old 2025-01-27 20:51:58.582525137 +0100
+++ /var/tmp/diff_new_pack.w589Ow/_new 2025-01-27 20:51:58.606526127 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-tasty-quickcheck
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,12 +20,13 @@
%global pkgver %{pkg_name}-%{version}
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.11
+Version: 0.11.1
Release: 0
Summary: QuickCheck support for the Tasty test framework
License: MIT
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+Source1:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-QuickCheck-prof
@@ -42,8 +43,8 @@
BuildRequires: ghc-tasty-prof
ExcludeArch: %{ix86}
%if %{with tests}
-BuildRequires: ghc-pcre-light-devel
-BuildRequires: ghc-pcre-light-prof
+BuildRequires: ghc-regex-tdfa-devel
+BuildRequires: ghc-regex-tdfa-prof
BuildRequires: ghc-tasty-hunit-devel
BuildRequires: ghc-tasty-hunit-prof
%endif
@@ -80,6 +81,7 @@
%prep
%autosetup -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ tasty-quickcheck-0.11.tar.gz -> tasty-quickcheck-0.11.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasty-quickcheck-0.11/CHANGELOG.md
new/tasty-quickcheck-0.11.1/CHANGELOG.md
--- old/tasty-quickcheck-0.11/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/tasty-quickcheck-0.11.1/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -1,6 +1,18 @@
Changes
=======
+Version 0.11.1
+--------------
+
+* Add timeouts for individual tests within a property
+ ([#425](https://github.com/UnkindPartition/tasty/pull/425)).
+* Define `showDefaultValue` for `QuickCheckTests`,
+ `QuickCheckMaxSize` and `QuickCheckMaxRatio`
+ ([#428](https://github.com/UnkindPartition/tasty/pull/428)).
+* Print the number of QuickCheck shrinks in the progress message
+ ([#431](https://github.com/UnkindPartition/tasty/pull/431)).
+* Drop support for GHC 7.10.
+
Version 0.11
--------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasty-quickcheck-0.11/Test/Tasty/QuickCheck.hs
new/tasty-quickcheck-0.11.1/Test/Tasty/QuickCheck.hs
--- old/tasty-quickcheck-0.11/Test/Tasty/QuickCheck.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/tasty-quickcheck-0.11.1/Test/Tasty/QuickCheck.hs 2001-09-09
03:46:40.000000000 +0200
@@ -10,6 +10,7 @@
, QuickCheckMaxRatio(..)
, QuickCheckVerbose(..)
, QuickCheckMaxShrinks(..)
+ , QuickCheckTimeout(..)
-- * Re-export of Test.QuickCheck
, module Test.QuickCheck
-- * Internal
@@ -20,7 +21,7 @@
, optionSetToArgs
) where
-import Test.Tasty ( testGroup )
+import Test.Tasty ( testGroup, Timeout(..) )
import Test.Tasty.Providers
import Test.Tasty.Options
import qualified Test.QuickCheck as QC
@@ -118,8 +119,15 @@
newtype QuickCheckMaxShrinks = QuickCheckMaxShrinks Int
deriving (Num, Ord, Eq, Real, Enum, Integral, Typeable)
+-- | Timeout for individual tests within a property.
+--
+-- @since 0.11.1
+newtype QuickCheckTimeout = QuickCheckTimeout Timeout
+ deriving (Eq, Ord, Typeable)
+
instance IsOption QuickCheckTests where
defaultValue = 100
+ showDefaultValue (QuickCheckTests n) = Just (show n)
parseValue =
-- We allow numeric underscores for readability; see
-- https://github.com/UnkindPartition/tasty/issues/263
@@ -149,6 +157,7 @@
instance IsOption QuickCheckMaxSize where
defaultValue = fromIntegral defaultMaxSize
+ showDefaultValue (QuickCheckMaxSize n) = Just (show n)
parseValue = fmap QuickCheckMaxSize . safeRead
optionName = return "quickcheck-max-size"
optionHelp = return "Size of the biggest test cases quickcheck generates"
@@ -156,6 +165,7 @@
instance IsOption QuickCheckMaxRatio where
defaultValue = fromIntegral $ QC.maxDiscardRatio QC.stdArgs
+ showDefaultValue (QuickCheckMaxRatio n) = Just (show n)
parseValue = fmap QuickCheckMaxRatio . safeRead
optionName = return "quickcheck-max-ratio"
optionHelp = return "Maximum number of discared tests per successful test
before giving up"
@@ -175,6 +185,13 @@
optionHelp = return "Number of shrinks allowed before QuickCheck will fail a
test"
optionCLParser = mkOptionCLParser $ metavar "NUMBER"
+instance IsOption QuickCheckTimeout where
+ defaultValue = QuickCheckTimeout defaultValue
+ parseValue = fmap QuickCheckTimeout . parseValue
+ optionName = return "quickcheck-timeout"
+ optionHelp = return "Timeout for individual tests within a QuickCheck
property (suffixes: ms,s,m,h; default: s)"
+ optionCLParser = mkOptionCLParser $ metavar "DURATION"
+
-- | Convert tasty options into QuickCheck options.
--
-- This is a low-level function that was originally added for tasty-hspec
@@ -221,6 +238,7 @@
, Option (Proxy :: Proxy QuickCheckMaxRatio)
, Option (Proxy :: Proxy QuickCheckVerbose)
, Option (Proxy :: Proxy QuickCheckMaxShrinks)
+ , Option (Proxy :: Proxy QuickCheckTimeout)
]
run opts (QC prop) yieldProgress = do
@@ -228,11 +246,16 @@
let
QuickCheckShowReplay showReplay = lookupOption opts
QuickCheckVerbose verbose = lookupOption opts
+ QuickCheckTimeout timeout = lookupOption opts
+ applyTimeout = case timeout of
+ Timeout micros _
+ | micros <= toInteger (maxBound :: Int) -> QC.within (fromInteger
micros)
+ _ -> id
-- Quickcheck already catches exceptions, no need to do it here.
r <- quickCheck yieldProgress
args
- (if verbose then QC.verbose prop else prop)
+ (applyTimeout $ if verbose then QC.verbose prop else prop)
qcOutput <- formatMessage $ QC.output r
let qcOutputNl =
@@ -260,8 +283,21 @@
= (.) (QC.quickCheckWithResult args)
$ QCP.callback
$ QCP.PostTest QCP.NotCounterexample
- $ \QC.MkState {QC.maxSuccessTests, QC.numSuccessTests} _ ->
- yieldProgress $ emptyProgress {progressPercent = fromIntegral
numSuccessTests / fromIntegral maxSuccessTests}
+ $ \[email protected] {QC.maxSuccessTests, QC.numSuccessTests} _ ->
+ yieldProgress $
+ if QC.numTotTryShrinks st > 0 then
+ emptyProgress {
+ progressText = showShrinkCount st
+ }
+ else
+ emptyProgress {
+ progressPercent = fromIntegral numSuccessTests / fromIntegral
maxSuccessTests
+ }
+
+-- Based on 'QuickCheck.Test.failureSummaryAndReason'.
+showShrinkCount :: QC.State -> String
+showShrinkCount st = show (QC.numSuccessShrinks st) ++ " shrink" ++ plural
+ where plural = if QC.numSuccessShrinks st == 1 then "" else "s"
successful :: QC.Result -> Bool
successful r =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasty-quickcheck-0.11/tasty-quickcheck.cabal
new/tasty-quickcheck-0.11.1/tasty-quickcheck.cabal
--- old/tasty-quickcheck-0.11/tasty-quickcheck.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/tasty-quickcheck-0.11.1/tasty-quickcheck.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,8 +1,5 @@
--- Initial tasty-quickcheck.cabal generated by cabal init. For further
--- documentation, see http://haskell.org/cabal/users-guide/
-
name: tasty-quickcheck
-version: 0.11
+version: 0.11.1
synopsis: QuickCheck support for the Tasty test framework.
description: QuickCheck support for the Tasty test framework.
.
@@ -10,7 +7,6 @@
license-file: LICENSE
author: Roman Cheplyaka <[email protected]>
maintainer: Roman Cheplyaka <[email protected]>
--- copyright:
homepage: https://github.com/UnkindPartition/tasty
bug-reports: https://github.com/UnkindPartition/tasty/issues
category: Testing
@@ -25,16 +21,14 @@
library
exposed-modules: Test.Tasty.QuickCheck
- -- other-modules:
other-extensions: GeneralizedNewtypeDeriving, DeriveDataTypeable
- build-depends: base >= 4.8 && < 5,
+ build-depends: base >= 4.9 && < 5,
tagged < 0.9,
- tasty >= 1.5 && < 1.6,
+ tasty >= 1.5.1 && < 1.6,
random < 1.3,
QuickCheck >= 2.10 && < 2.16,
optparse-applicative < 0.19
- -- hs-source-dirs:
default-language: Haskell2010
default-extensions: CPP
ghc-options: -Wall
@@ -50,12 +44,10 @@
main-is:
test.hs
build-depends:
- base >= 4.7 && < 5
- , tasty >= 1.5
+ base
+ , regex-tdfa >= 1.3 && < 1.4
+ , tasty
, tasty-quickcheck
, tasty-hunit
- , pcre-light
, QuickCheck
ghc-options: -Wall
- if (!impl(ghc >= 8.0) || os(windows))
- buildable: False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasty-quickcheck-0.11/tests/test.hs
new/tasty-quickcheck-0.11.1/tests/test.hs
--- old/tasty-quickcheck-0.11/tests/test.hs 2001-09-09 03:46:40.000000000
+0200
+++ new/tasty-quickcheck-0.11.1/tests/test.hs 2001-09-09 03:46:40.000000000
+0200
@@ -7,10 +7,9 @@
import Test.Tasty.Runners as Tasty
import Test.Tasty.QuickCheck
import Test.Tasty.HUnit
-import Data.Maybe
import Test.QuickCheck.Random (QCGen)
-import Text.Regex.PCRE.Light.Char8
import Text.Printf
+import qualified Text.Regex.TDFA as Regex
(=~), (!~)
:: String -- ^ text
@@ -21,20 +20,11 @@
msg = printf "Expected /%s/, got %s" regexStr (show text)
-- NB show above the intentional -- to add quotes around the string and
-- escape newlines etc.
- in assertBool msg $ match' text regexStr
+ in assertBool msg $ text Regex.=~ regexStr
text !~ regexStr =
let
msg = printf "Did not expect /%s/, got %s" regexStr (show text)
- in assertBool msg $ not $ match' text regexStr
-
--- note: the order of arguments is reversed relative to match from
--- pcre-light, but consistent with =~ and !~
-match' :: String -> String -> Bool
-match' text regexStr =
- let
- regex = compile regexStr []
- in
- isJust $ match regex text []
+ in assertBool msg $ not $ text Regex.=~ regexStr
main :: IO ()
main =
@@ -110,8 +100,11 @@
resultDescription =~ "Use .* to reproduce"
-- Run the test suite manually and check that progress does not go
beyond 100%
- , testProperty "Percent Complete" $ withMaxSuccess 1000 $ \(_ :: Int) ->
ioProperty $ threadDelay 10000
-
+ , testProperty "Percent Complete" $
+ withMaxSuccess 1000 $ \(_ :: Int) -> ioProperty $ threadDelay 10000
+ , testProperty "Number of shrinks" $
+ expectFailure $ withMaxSize 1000 $ \(Large (x :: Int)) ->
+ ioProperty $ threadDelay 100000 >> pure (x <= 100)
]
run' :: Testable p => p -> IO Result
++++++ tasty-quickcheck.cabal ++++++
name: tasty-quickcheck
version: 0.11.1
x-revision: 1
synopsis: QuickCheck support for the Tasty test framework.
description: QuickCheck support for the Tasty test framework.
.
license: MIT
license-file: LICENSE
author: Roman Cheplyaka <[email protected]>
maintainer: Roman Cheplyaka <[email protected]>
homepage: https://github.com/UnkindPartition/tasty
bug-reports: https://github.com/UnkindPartition/tasty/issues
category: Testing
build-type: Simple
extra-source-files: CHANGELOG.md
cabal-version: >=1.10
Source-repository head
type: git
location: https://github.com/UnkindPartition/tasty.git
subdir: quickcheck
library
exposed-modules: Test.Tasty.QuickCheck
other-extensions: GeneralizedNewtypeDeriving, DeriveDataTypeable
build-depends: base >= 4.9 && < 5,
tagged < 0.9,
tasty >= 1.5.1 && < 1.6,
random < 1.4,
QuickCheck >= 2.10 && < 2.16,
optparse-applicative < 0.19
default-language: Haskell2010
default-extensions: CPP
ghc-options: -Wall
test-suite test
default-language:
Haskell2010
default-extensions: CPP
type:
exitcode-stdio-1.0
hs-source-dirs:
tests
main-is:
test.hs
build-depends:
base
, regex-tdfa >= 1.3 && < 1.4
, tasty
, tasty-quickcheck
, tasty-hunit
, QuickCheck
ghc-options: -Wall