Hello community,

here is the log from the commit of package ghc-QuickCheck for openSUSE:Factory 
checked in at 2013-08-01 15:32:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-QuickCheck (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-QuickCheck.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-QuickCheck"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-QuickCheck/ghc-QuickCheck.changes    
2013-01-07 15:13:47.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-QuickCheck.new/ghc-QuickCheck.changes       
2013-08-01 15:32:32.000000000 +0200
@@ -1,0 +2,10 @@
+Mon May  6 11:31:28 UTC 2013 - [email protected]
+
+- update to 2.6 from upstream
+* convenience instances for up to 7-tupels
+* stderr unbuffered
+* flag to say whether test case was interrupted
+- BR ghc-extensible-exceptions-devel no longer required 
+- more transparent packaging (fewer macros)
+
+-------------------------------------------------------------------

Old:
----
  QuickCheck-2.5.1.1.tar.gz

New:
----
  QuickCheck-2.6.tar.gz

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

Other differences:
------------------
++++++ ghc-QuickCheck.spec ++++++
--- /var/tmp/diff_new_pack.AG9c2u/_old  2013-08-01 15:32:32.000000000 +0200
+++ /var/tmp/diff_new_pack.AG9c2u/_new  2013-08-01 15:32:32.000000000 +0200
@@ -1,7 +1,7 @@
 #
-# spec file for ghc-QuickCheck
+# spec file for package ghc-QuickCheck
 #
-
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # Copyright (c) 2012 Peter Trommler [email protected]
 #
 # All modifications and additions to the file contributed by third parties
@@ -16,6 +16,10 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
 %global pkg_name QuickCheck
 
 %global common_summary Automatic testing of Haskell programs
@@ -23,49 +27,57 @@
 %global common_description QuickCheck is a library for random testing of 
program properties.
 
 Name:           ghc-QuickCheck
-Version:        2.5.1.1
-Release:        1
+Version:        2.6
+Release:        0
 Summary:        %{common_summary}
-
-Group:          System/Libraries
 License:        BSD-3-Clause
+Group:          System/Libraries
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 # BEGIN cabal2spec
-URL:            http://hackage.haskell.org/package/%{pkg_name}
+Url:            http://hackage.haskell.org/package/%{pkg_name}
 Source0:        
http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz
 ExclusiveArch:  %{ix86} x86_64 %{ghc_arches}
 BuildRequires:  ghc-Cabal-devel
-BuildRequires:  ghc-rpm-macros %{!?without_hscolour:hscolour}
-BuildRequires:  ghc-extensible-exceptions-devel
 BuildRequires:  ghc-random-devel
+BuildRequires:  ghc-rpm-macros
 # END cabal2spec
 
 %description
 %{common_description}
 
+%package devel
+Summary:        Haskell %{pkg_name} library development files
+Group:          Development/Languages/Other
+Requires:       ghc-compiler
+Requires(post): ghc-compiler
+Requires(postun): ghc-compiler
+Requires:       %{name} = %{version}-%{release}
+
+%description devel
+%{common_description}
+This package contains the development files.
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
 
-
 %build
 %ghc_lib_build
 
-
 %install
 %ghc_lib_install
 
+%post devel
+%ghc_pkg_recache
 
-# devel subpackage
-%ghc_devel_package
-
-%ghc_devel_description
-
-
-%ghc_devel_post_postun
-
+%postun devel
+%ghc_pkg_recache
 
-%ghc_files LICENSE
+%files -f %{name}.files
+%defattr(-,root,root,-)
+%doc LICENSE README
 
+%files devel -f %{name}-devel.files
+%defattr(-,root,root,-)
 
 %changelog

++++++ QuickCheck-2.5.1.1.tar.gz -> QuickCheck-2.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/QuickCheck-2.5.1.1/QuickCheck.cabal 
new/QuickCheck-2.6/QuickCheck.cabal
--- old/QuickCheck-2.5.1.1/QuickCheck.cabal     2012-09-23 00:24:43.000000000 
+0200
+++ new/QuickCheck-2.6/QuickCheck.cabal 2013-03-07 16:07:41.000000000 +0100
@@ -1,5 +1,5 @@
 Name: QuickCheck
-Version: 2.5.1.1
+Version: 2.6
 Cabal-Version: >= 1.6
 Build-type: Simple
 License: BSD3
@@ -29,11 +29,11 @@
 
 source-repository head
   type:     git
-  location: git://github.com/nick8325/quickcheck
+  location: https://github.com/nick8325/quickcheck
 
 source-repository this
   type:     git
-  location: git://github.com/nick8325/quickcheck
+  location: https://github.com/nick8325/quickcheck
   tag:      2.5.1.1
 
 flag base3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/QuickCheck-2.5.1.1/Test/QuickCheck/Exception.hs 
new/QuickCheck-2.6/Test/QuickCheck/Exception.hs
--- old/QuickCheck-2.5.1.1/Test/QuickCheck/Exception.hs 2012-09-23 
00:24:43.000000000 +0200
+++ new/QuickCheck-2.6/Test/QuickCheck/Exception.hs     2013-03-07 
16:07:41.000000000 +0100
@@ -20,19 +20,10 @@
 #endif
 #endif
 
-#if defined(OLD_EXCEPTIONS)
-import Control.Exception(evaluate, try, Exception(..), throw)
-#else
-#if defined(NO_BASE_3)
-import Control.Exception
+#if defined(OLD_EXCEPTIONS) || defined(NO_BASE_3)
+import qualified Control.Exception as E
 #else
-import Control.Exception.Extensible
-#endif
-  (evaluate, try, SomeException(SomeException), ErrorCall(..), throw
-#if defined(GHC_INTERRUPT)
-  , AsyncException(UserInterrupt)
-#endif
-  )
+import qualified Control.Exception.Extensible as E
 #endif
 
 #if defined(GHC_INTERRUPT)
@@ -46,9 +37,9 @@
 #endif
 
 #if defined(OLD_EXCEPTIONS)
-type AnException = Control.Exception.Exception
+type AnException = E.Exception
 #else
-type AnException = SomeException
+type AnException = E.SomeException
 #endif
 
 --------------------------------------------------------------------------
@@ -58,7 +49,7 @@
 tryEvaluate x = tryEvaluateIO (return x)
 
 tryEvaluateIO :: IO a -> IO (Either AnException a)
-tryEvaluateIO m = try (m >>= evaluate)
+tryEvaluateIO m = E.try (m >>= E.evaluate)
 --tryEvaluateIO m = Right `fmap` m
 
 -- Test if an exception was a ^C.
@@ -67,13 +58,13 @@
 
 #if defined(GHC_INTERRUPT)
 #if defined(OLD_EXCEPTIONS)
-isInterrupt (DynException e) = fromDynamic e == Just Interrupted
+isInterrupt (E.DynException e) = fromDynamic e == Just Interrupted
 isInterrupt _ = False
 #elif defined(GHCI_INTERRUPTED_EXCEPTION)
-isInterrupt (SomeException e) =
-  cast e == Just Interrupted || cast e == Just UserInterrupt
+isInterrupt (E.SomeException e) =
+  cast e == Just Interrupted || cast e == Just E.UserInterrupt
 #else
-isInterrupt (SomeException e) = cast e == Just UserInterrupt
+isInterrupt (E.SomeException e) = cast e == Just E.UserInterrupt
 #endif
 
 #else /* !defined(GHC_INTERRUPT) */
@@ -87,20 +78,22 @@
 discard :: a
 
 isDiscard :: AnException -> Bool
-(discard, isDiscard) = (throw (ErrorCall msg), isDiscard)
+(discard, isDiscard) = (E.throw (E.ErrorCall msg), isDiscard)
  where
   msg = "DISCARD. " ++
         "You should not see this exception, it is internal to QuickCheck."
 #if defined(OLD_EXCEPTIONS)
-  isDiscard (ErrorCall msg') = msg' == msg
+  isDiscard (E.ErrorCall msg') = msg' == msg
   isDiscard _ = False
 #else
-  isDiscard (SomeException e) =
+  isDiscard (E.SomeException e) =
     case cast e of
-      Just (ErrorCall msg') -> msg' == msg
+      Just (E.ErrorCall msg') -> msg' == msg
       _ -> False
 #endif
 
+finally :: IO a -> IO b -> IO a
+finally = E.finally
 
 --------------------------------------------------------------------------
 -- the end.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/QuickCheck-2.5.1.1/Test/QuickCheck/Function.hs 
new/QuickCheck-2.6/Test/QuickCheck/Function.hs
--- old/QuickCheck-2.5.1.1/Test/QuickCheck/Function.hs  2012-09-23 
00:24:43.000000000 +0200
+++ new/QuickCheck-2.6/Test/QuickCheck/Function.hs      2013-03-07 
16:07:41.000000000 +0100
@@ -32,7 +32,6 @@
 
 import Test.QuickCheck.Arbitrary
 import Test.QuickCheck.Poly
-import Test.QuickCheck.Exception(discard)
 
 import Data.Char
 import Data.Word
@@ -111,6 +110,23 @@
 instance (Function a, Function b) => Function (Either a b) where
   function f = function (f . Left) :+: function (f . Right)
 
+-- tuple convenience instances
+
+instance (Function a, Function b, Function c) => Function (a,b,c) where
+  function = functionMap (\(a,b,c) -> (a,(b,c))) (\(a,(b,c)) -> (a,b,c))
+
+instance (Function a, Function b, Function c, Function d) => Function 
(a,b,c,d) where
+  function = functionMap (\(a,b,c,d) -> (a,(b,c,d))) (\(a,(b,c,d)) -> 
(a,b,c,d))
+
+instance (Function a, Function b, Function c, Function d, Function e) => 
Function (a,b,c,d,e) where
+  function = functionMap (\(a,b,c,d,e) -> (a,(b,c,d,e))) (\(a,(b,c,d,e)) -> 
(a,b,c,d,e))
+
+instance (Function a, Function b, Function c, Function d, Function e, Function 
f) => Function (a,b,c,d,e,f) where
+  function = functionMap (\(a,b,c,d,e,f) -> (a,(b,c,d,e,f))) (\(a,(b,c,d,e,f)) 
-> (a,b,c,d,e,f))
+
+instance (Function a, Function b, Function c, Function d, Function e, Function 
f, Function g) => Function (a,b,c,d,e,f,g) where
+  function = functionMap (\(a,b,c,d,e,f,g) -> (a,(b,c,d,e,f,g))) 
(\(a,(b,c,d,e,f,g)) -> (a,b,c,d,e,f,g))
+
 -- other instances
 
 functionMap :: Function b => (a->b) -> (b->a) -> (a->c) -> (a:->c)
@@ -207,8 +223,8 @@
   pair p   = Pair p
 
 shrinkFun shr (p :+: q) =
-  [ p .+. Nil `whenever` not (isNil q) ] ++
-  [ Nil .+. q `whenever` not (isNil p) ] ++
+  [ p .+. Nil | not (isNil q) ] ++
+  [ Nil .+. q | not (isNil p) ] ++
   [ p  .+. q' | q' <- shrinkFun shr q ] ++
   [ p' .+. q  | p' <- shrinkFun shr p ]
  where
@@ -219,9 +235,6 @@
   Nil .+. Nil = Nil
   p   .+. q   = p :+: q
 
-  p `whenever` True = p
-  p `whenever` False = discard
-
 shrinkFun shr (Unit c) =
   [ Nil ] ++
   [ Unit c' | c' <- shr c ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/QuickCheck-2.5.1.1/Test/QuickCheck/Test.hs 
new/QuickCheck-2.6/Test/QuickCheck/Test.hs
--- old/QuickCheck-2.5.1.1/Test/QuickCheck/Test.hs      2012-09-23 
00:24:43.000000000 +0200
+++ new/QuickCheck-2.6/Test/QuickCheck/Test.hs  2013-03-07 16:07:41.000000000 
+0100
@@ -60,6 +60,7 @@
     , usedSeed       :: StdGen         -- ^ what seed was used
     , usedSize       :: Int            -- ^ what was the test size
     , reason         :: String         -- ^ what was the reason
+    , interrupted    :: Bool           -- ^ did the user press ctrl-C?
     , labels         :: [(String,Int)] -- ^ labels and frequencies found 
during all successful tests
     , output         :: String         -- ^ printed output
     }
@@ -100,8 +101,7 @@
 
 -- | Tests a property, using test arguments, produces a test result, and 
prints the results to 'stdout'.
 quickCheckWithResult :: Testable prop => Args -> prop -> IO Result
-quickCheckWithResult a p =
-  do tm <- if chatty a then newStdioTerminal else newNullTerminal
+quickCheckWithResult a p = (if chatty a then withStdioTerminal else 
withNullTerminal) $ \tm -> do
      rnd <- case replay a of
               Nothing      -> newStdGen
               Just (rnd,_) -> return rnd
@@ -258,6 +258,7 @@
                             , numShrinks  = numShrinks
                             , output      = theOutput
                             , reason      = P.reason res
+                            , interrupted = P.interrupted res
                             , labels      = summary st
                             }
  where
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/QuickCheck-2.5.1.1/Test/QuickCheck/Text.hs 
new/QuickCheck-2.6/Test/QuickCheck/Text.hs
--- old/QuickCheck-2.5.1.1/Test/QuickCheck/Text.hs      2012-09-23 
00:24:43.000000000 +0200
+++ new/QuickCheck-2.6/Test/QuickCheck/Text.hs  2013-03-07 16:07:41.000000000 
+0100
@@ -10,8 +10,8 @@
   , bold
 
   , newTerminal
-  , newStdioTerminal
-  , newNullTerminal
+  , withStdioTerminal
+  , withNullTerminal
   , terminalOutput
   , handle
   , Terminal
@@ -24,15 +24,20 @@
 --------------------------------------------------------------------------
 -- imports
 
+import Control.Applicative
 import System.IO
   ( hFlush
   , hPutStr
   , stdout
   , stderr
   , Handle
+  , BufferMode (..)
+  , hGetBuffering
+  , hSetBuffering
   )
 
 import Data.IORef
+import Test.QuickCheck.Exception
 
 --------------------------------------------------------------------------
 -- literal string
@@ -89,17 +94,25 @@
   do ref <- newIORef (return ())
      return (MkTerminal ref out err)
 
-newStdioTerminal :: IO Terminal
-newStdioTerminal = do
+withBuffering :: IO a -> IO a
+withBuffering action = do
+  mode <- hGetBuffering stderr
+  -- By default stderr is unbuffered.  This is very slow, hence we explicitly
+  -- enable line buffering.
+  hSetBuffering stderr LineBuffering
+  action `finally` hSetBuffering stderr mode
+
+withStdioTerminal :: (Terminal -> IO a) -> IO a
+withStdioTerminal action = do
   out <- output (handle stdout)
   err <- output (handle stderr)
-  newTerminal out err
+  withBuffering (newTerminal out err >>= action)
 
-newNullTerminal :: IO Terminal
-newNullTerminal = do
+withNullTerminal :: (Terminal -> IO a) -> IO a
+withNullTerminal action = do
   out <- output (const (return ()))
   err <- output (const (return ()))
-  newTerminal out err
+  newTerminal out err >>= action
 
 terminalOutput :: Terminal -> IO String
 terminalOutput (MkTerminal _ out _) = get out
@@ -140,8 +153,7 @@
 
 putTemp tm@(MkTerminal _ _ err) s =
   do flush tm
-     put err s
-     put err [ '\b' | _ <- s ]
+     put err (s ++ [ '\b' | _ <- s ])
      postpone tm $
        put err ( [ ' ' | _ <- s ]
               ++ [ '\b' | _ <- s ]
@@ -149,8 +161,7 @@
 
 putLine tm@(MkTerminal _ out _) s =
   do flush tm
-     put out s
-     put out "\n"
+     put out (s ++ "\n")
 
 --------------------------------------------------------------------------
 -- the end.

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to