commit ghc-quickcheck-assertions for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-quickcheck-assertions for openSUSE:Factory checked in at 2017-04-17 10:25:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-quickcheck-assertions (Old) and /work/SRC/openSUSE:Factory/.ghc-quickcheck-assertions.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-quickcheck-assertions" Mon Apr 17 10:25:23 2017 rev:2 rq:483931 version:0.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-quickcheck-assertions/ghc-quickcheck-assertions.changes 2017-03-24 01:57:13.371534805 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-quickcheck-assertions.new/ghc-quickcheck-assertions.changes 2017-04-17 10:25:27.985392915 +0200 @@ -1,0 +2,5 @@ +Sun Feb 12 14:17:45 UTC 2017 - psimons@suse.com + +- Update to version 0.3.0 with cabal2obs. + +------------------------------------------------------------------- Old: ---- quickcheck-assertions-0.2.0.tar.gz New: ---- quickcheck-assertions-0.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-quickcheck-assertions.spec ++++++ --- /var/tmp/diff_new_pack.GUOaAh/_old 2017-04-17 10:25:29.053241688 +0200 +++ /var/tmp/diff_new_pack.GUOaAh/_new 2017-04-17 10:25:29.057241122 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-quickcheck-assertions # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,16 +19,17 @@ %global pkg_name quickcheck-assertions %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.0 +Version: 0.3.0 Release: 0 Summary: HUnit like assertions for QuickCheck -License: LGPL-3+ +License: LGPL-3.0+ Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel BuildRequires: ghc-QuickCheck-devel BuildRequires: ghc-ieee754-devel +BuildRequires: ghc-pretty-show-devel BuildRequires: ghc-rpm-macros BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with tests} @@ -74,5 +75,6 @@ %files devel -f %{name}-devel.files %defattr(-,root,root,-) +%doc CHANGELOG.md README.md %changelog ++++++ quickcheck-assertions-0.2.0.tar.gz -> quickcheck-assertions-0.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quickcheck-assertions-0.2.0/CHANGELOG.md new/quickcheck-assertions-0.3.0/CHANGELOG.md --- old/quickcheck-assertions-0.2.0/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/quickcheck-assertions-0.3.0/CHANGELOG.md 2017-01-17 12:53:37.000000000 +0100 @@ -0,0 +1,5 @@ +# 0.3.0 + +* Changelog added +* Use pretty-show for error descriptions (usefull with huge test + cases) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quickcheck-assertions-0.2.0/README.md new/quickcheck-assertions-0.3.0/README.md --- old/quickcheck-assertions-0.2.0/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/quickcheck-assertions-0.3.0/README.md 2017-01-17 12:21:52.000000000 +0100 @@ -0,0 +1,49 @@ +Module provides convenient functions to do some assertions in QuickCheck +properties with pretty printed reasons. For example you can do something like +that: + +```haskell +module Main where + +import Test.Hspec +import Test.Hspec.QuickCheck +import Test.QuickCheck.Assertions +import Test.QuickCheck.Property + +someProp :: Int -> Int -> Result +someProp a b = (a ?> b) + +someOtherProp :: Double -> Double -> Result +someOtherProp a b = (a ?== b) + +main = hspec $ describe "failing test" $ do + prop "must fail" $ someProp + prop "must fail again" $ someOtherProp +``` + +And receive pretty printed fail message when testing: + +``` +failing test + - must fail FAILED [1] + - must fail again FAILED [2] + +1) failing test must fail FAILED +*** Failed! (after 1 test): +>>>>>>>>>>>>>> the value +0 +>>>>>>>>>>>>>> should be greater than value +0 +0 +0 + + +2) failing test must fail again FAILED +*** Failed! (after 2 tests and 4 shrinks): +>>>>>>>>>>>>>> expected +0.0 +>>>>>>>>>>>>>> but got +1.0 +0.0 +1.0 +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quickcheck-assertions-0.2.0/Test/QuickCheck/Assertions.hs new/quickcheck-assertions-0.3.0/Test/QuickCheck/Assertions.hs --- old/quickcheck-assertions-0.2.0/Test/QuickCheck/Assertions.hs 2015-01-24 14:24:55.000000000 +0100 +++ new/quickcheck-assertions-0.3.0/Test/QuickCheck/Assertions.hs 2017-01-17 12:25:50.000000000 +0100 @@ -66,27 +66,27 @@ , Result ) where -import Test.QuickCheck.Property import Data.AEq +import Test.QuickCheck.Property +import Text.Show.Pretty - - -binAsrt :: String -- ^ The reason of fail - -> Bool -- ^ If True then test pass - -> Result -- ^ The result with fail reason -binAsrt fmt pre = if pre - then succeeded - else failed {reason = fmt} - +binAsrt + :: String -- ^ The reason of fail + -> Bool -- ^ If True then test pass + -> Result -- ^ The result with fail reason +binAsrt fmt pre = + if pre + then succeeded + else failed {reason = fmt} -- | Left argument should be equal to right (?==) :: (Eq a, Show a) => a -> a -> Result (?==) a b = binAsrt s (a == b) where s = "\n>>>>>>>>>>>>>> expected\n" -- very stupid formater for now - ++ show b ++ + ++ ppShow b ++ "\n>>>>>>>>>>>>>> but got\n" - ++ show a + ++ ppShow a -- | Right argument should be equal to left (==?) :: (Eq a, Show a) => a -> a -> Result @@ -97,9 +97,9 @@ (?/=) a b = binAsrt s (a /= b) where s = "\n>>>>>>>>>>>>>> expected the value\n" - ++ show a ++ + ++ ppShow a ++ "\n>>>>>>>>>>>>>> should not equal to\n" - ++ show b + ++ ppShow b -- | Right argument should not equal to left (/=?) :: (Eq a, Show a) => a -> a -> Result @@ -115,9 +115,9 @@ binOrdering pre fmt a b = binAsrt s (pre $ compare a b) where s = "\n>>>>>>>>>>>>>> the value\n" - ++ show a ++ + ++ ppShow a ++ "\n>>>>>>>>>>>>>> should be " ++ fmt ++ " than value\n" - ++ show b + ++ ppShow b -- | Left argument is greater than right @@ -157,9 +157,9 @@ (?~==) a b = binAsrt s (a ~== b) where s = "\n>>>>>>>>>>>>>> The value\n" - ++ show a ++ + ++ ppShow a ++ "\n>>>>>>>>>>>>>> should be almost equal to\n" - ++ show b + ++ ppShow b -- | Right value is almost equal to left (~==?) :: (AEq a, Show a) => a -> a -> Result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quickcheck-assertions-0.2.0/quickcheck-assertions.cabal new/quickcheck-assertions-0.3.0/quickcheck-assertions.cabal --- old/quickcheck-assertions-0.2.0/quickcheck-assertions.cabal 2015-01-24 14:24:55.000000000 +0100 +++ new/quickcheck-assertions-0.3.0/quickcheck-assertions.cabal 2017-01-17 12:53:37.000000000 +0100 @@ -1,5 +1,5 @@ name: quickcheck-assertions -version: 0.2.0 +version: 0.3.0 synopsis: HUnit like assertions for QuickCheck description: Library with convenient assertions for QuickCheck properties like in HUnit license: LGPL-3 @@ -11,6 +11,10 @@ build-type: Simple cabal-version: >=1.8 homepage: https://github.com/s9gf4ult/quickcheck-assertions + +extra-source-files: CHANGELOG.md + , README.md + source-repository head type: git location: git://github.com/s9gf4ult/quickcheck-assertions.git @@ -19,9 +23,10 @@ library exposed-modules: Test.QuickCheck.Assertions -- other-modules: - build-depends: base == 4.* - , QuickCheck >= 2.3 + build-depends: QuickCheck >= 2.3 + , base == 4.* , ieee754 + , pretty-show ghc-options: -Wall test-suite main @@ -33,4 +38,4 @@ , ieee754 ghc-options: -Wall -rtsopts hs-source-dirs: tests - main-is: main.hs \ No newline at end of file + main-is: main.hs
participants (1)
-
root@hilbert.suse.de