Hello community, here is the log from the commit of package ghc-hspec for openSUSE:Factory checked in at 2018-05-30 12:09:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-hspec (Old) and /work/SRC/openSUSE:Factory/.ghc-hspec.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-hspec" Wed May 30 12:09:01 2018 rev:4 rq:607814 version:2.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-hspec/ghc-hspec.changes 2017-09-15 21:49:45.238775882 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-hspec.new/ghc-hspec.changes 2018-05-30 12:25:58.708993968 +0200 @@ -1,0 +2,26 @@ +Mon May 14 17:02:11 UTC 2018 - psimons@suse.com + +- Update hspec to version 2.5.0. + - Add support for `--diff` when `shouldBe` is uesd with + `QuickCheck`-properties + - Add source locations when `shouldBe` is uesd with `QuickCheck`-properties + - Add `sequential` (see #311) + - Colorize whitespaces with background color instead of foreground color with + `--diff` + - Deprecate `--out` + - Removed deprecated module `Test.Hspec.HUnit`, use + `Test.Hspec.Contrib.HUnit` instead + - Run `Test.Hspec.Core.Formatters.exampleProgress` in `FormatM` instead of + `IO` + - Print QuickCheck labels on success (see #297) + - Include column when formatting source locations + - Extract source location from error / undefined (close #316) + - Remove BestEffort source locations + - Include duration for each spec item in new formatter API (see #315) + - Add location information to `pending` + - Make sure that progress output is always cleared (fixes #301) + - Parse source locations from pattern match failures + - compatibility with the upcoming version `4.11.0.0` of `base` + - `hspec-discover`: Sort specs using natural sort order + +------------------------------------------------------------------- Old: ---- hspec-2.4.4.tar.gz New: ---- hspec-2.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-hspec.spec ++++++ --- /var/tmp/diff_new_pack.3MMx2F/_old 2018-05-30 12:25:59.656962269 +0200 +++ /var/tmp/diff_new_pack.3MMx2F/_new 2018-05-30 12:25:59.656962269 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-hspec # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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,7 +19,7 @@ %global pkg_name hspec %bcond_with tests Name: ghc-%{pkg_name} -Version: 2.4.4 +Version: 2.5.0 Release: 0 Summary: A Testing Framework for Haskell License: MIT @@ -85,7 +85,7 @@ %ghc_pkg_recache %files -f %{name}.files -%doc LICENSE +%license LICENSE %files devel -f %{name}-devel.files %doc CHANGES.markdown ++++++ hspec-2.4.4.tar.gz -> hspec-2.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/CHANGES.markdown new/hspec-2.5.0/CHANGES.markdown --- old/hspec-2.4.4/CHANGES.markdown 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/CHANGES.markdown 2018-03-14 10:18:45.000000000 +0100 @@ -1,3 +1,33 @@ +## Changes in 2.5.0 + - Add support for `--diff` when `shouldBe` is uesd with + `QuickCheck`-properties + - Add source locations when `shouldBe` is uesd with `QuickCheck`-properties + - Add `sequential` (see #311) + - Colorize whitespaces with background color instead of foreground color with + `--diff` + - Deprecate `--out` + - Removed deprecated module `Test.Hspec.HUnit`, use + `Test.Hspec.Contrib.HUnit` instead + - Run `Test.Hspec.Core.Formatters.exampleProgress` in `FormatM` instead of + `IO` + - Print QuickCheck labels on success (see #297) + - Include column when formatting source locations + - Extract source location from error / undefined (close #316) + - Remove BestEffort source locations + - Include duration for each spec item in new formatter API (see #315) + - Add location information to `pending` + - Make sure that progress output is always cleared (fixes #301) + - Parse source locations from pattern match failures + +## Changes in 2.4.6 + - compatibility with the upcoming version `4.11.0.0` of `base` + +## Changes in 2.4.5 + - `hspec-discover`: Sort specs using natural sort order + +## Changes in 2.4.4 + - Require quickcheck-io >= 0.2.0 + ## Changes in 2.4.3 - Read command-line options from environment variable `HSPEC_OPTIONS` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/hspec.cabal new/hspec-2.5.0/hspec.cabal --- old/hspec-2.4.4/hspec.cabal 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/hspec.cabal 2018-03-14 10:18:45.000000000 +0100 @@ -1,9 +1,11 @@ --- This file has been generated from package.yaml by hpack version 0.18.0. +-- This file has been generated from package.yaml by hpack version 0.25.0. -- -- see: https://github.com/sol/hpack +-- +-- hash: 5973a094a7e1665acc54acbbf4e2edfaf3caf3f63f400d39fbbd281fa1479892 name: hspec -version: 2.4.4 +version: 2.5.0 license: MIT license-file: LICENSE copyright: (c) 2011-2017 Simon Hengel, @@ -43,20 +45,19 @@ hs-source-dirs: src build-depends: - base == 4.* - , hspec-core == 2.4.4 - , hspec-discover == 2.4.4 - , hspec-expectations == 0.8.2.* - , transformers >= 0.2.2.0 - , QuickCheck >= 2.5.1 - , HUnit >= 1.2.5 + HUnit >=1.5.0.0 + , QuickCheck >=2.10 + , base ==4.* , call-stack + , hspec-core ==2.5.0 + , hspec-discover ==2.5.0 + , hspec-expectations ==0.8.2.* + , transformers >=0.2.2.0 exposed-modules: Test.Hspec Test.Hspec.Core Test.Hspec.Discover Test.Hspec.Formatters - Test.Hspec.HUnit Test.Hspec.QuickCheck Test.Hspec.Runner other-modules: @@ -69,21 +70,19 @@ hs-source-dirs: test main-is: Spec.hs - other-modules: - Helper - HelperSpec - Test.Hspec.DiscoverSpec build-depends: - base == 4.* - , hspec-core == 2.4.4 - , hspec-discover == 2.4.4 - , hspec-expectations == 0.8.2.* - , transformers >= 0.2.2.0 - , QuickCheck >= 2.5.1 - , HUnit >= 1.2.5 + HUnit >=1.5.0.0 + , QuickCheck >=2.10 + , base ==4.* , call-stack - , hspec , directory + , hspec + , hspec-core ==2.5.0 + , hspec-discover ==2.5.0 + , hspec-expectations ==0.8.2.* + , hspec-meta >=2.3.2 , stringbuilder - , hspec-meta >= 2.3.2 + , transformers >=0.2.2.0 + other-modules: + Paths_hspec default-language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/src/Test/Hspec/Discover.hs new/hspec-2.5.0/src/Test/Hspec/Discover.hs --- old/hspec-2.4.4/src/Test/Hspec/Discover.hs 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/src/Test/Hspec/Discover.hs 2018-03-14 10:18:45.000000000 +0100 @@ -12,16 +12,10 @@ ) where import Prelude hiding (mapM) -import Control.Applicative -import Data.Maybe -import Data.List -import Data.Traversable -import Control.Monad.Trans.State import Test.Hspec.Core.Spec import Test.Hspec.Core.Runner import Test.Hspec.Formatters -import Test.Hspec.Core.Util (safeTry) class IsFormatter a where toFormatter :: a -> IO Formatter @@ -38,62 +32,4 @@ hspecWith defaultConfig {configFormatter = Just f} spec postProcessSpec :: FilePath -> Spec -> Spec -postProcessSpec = locationHeuristicFromFile - -locationHeuristicFromFile :: FilePath -> Spec -> Spec -locationHeuristicFromFile file spec = do - mInput <- either (const Nothing) Just <$> (runIO . safeTry . readFile) file - let lookupLoc = maybe (\_ _ _ -> Nothing) (lookupLocation file) mInput - runIO (runSpecM spec) >>= fromSpecList . addLoctions lookupLoc - -addLoctions :: (Int -> Int -> String -> Maybe Location) -> [SpecTree a] -> [SpecTree a] -addLoctions lookupLoc = map (fmap f) . enumerate - where - f :: ((Int, Int), Item a) -> Item a - f ((n, total), item) = item {itemLocation = itemLocation item <|> lookupLoc n total (itemRequirement item)} - -type EnumerateM = State [(String, Int)] - -enumerate :: [SpecTree a] -> [Tree (ActionWith a) ((Int, Int), (Item a))] -enumerate tree = (mapM (traverse addPosition) tree >>= mapM (traverse addTotal)) `evalState` [] - where - addPosition :: Item a -> EnumerateM (Int, Item a) - addPosition item = (,) <$> getOccurrence (itemRequirement item) <*> pure item - - addTotal :: (Int, Item a) -> EnumerateM ((Int, Int), Item a) - addTotal (n, item) = do - total <- getTotal (itemRequirement item) - return ((n, total), item) - - getTotal :: String -> EnumerateM Int - getTotal requirement = do - gets $ fromMaybe err . lookup requirement - where - err = error ("Test.Hspec.Discover.getTotal: No entry for requirement " ++ show requirement ++ "!") - - getOccurrence :: String -> EnumerateM Int - getOccurrence requirement = do - xs <- get - let n = maybe 1 succ (lookup requirement xs) - put ((requirement, n) : filter ((/= requirement) . fst) xs) - return n - -lookupLocation :: FilePath -> String -> Int -> Int -> String -> Maybe Location -lookupLocation file input n total requirement = loc - where - loc :: Maybe Location - loc = Location file <$> line <*> pure 0 <*> pure BestEffort - - line :: Maybe Int - line = case occurrences of - xs | length xs == total -> Just (xs !! pred n) - _ -> Nothing - - occurrences :: [Int] - occurrences = map fst (filter p inputLines) - where - p :: (Int, String) -> Bool - p = isInfixOf (show requirement) . snd - - inputLines :: [(Int, String)] - inputLines = zip [1..] (lines input) +postProcessSpec _ = id diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/src/Test/Hspec/HUnit.hs new/hspec-2.5.0/src/Test/Hspec/HUnit.hs --- old/hspec-2.4.4/src/Test/Hspec/HUnit.hs 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/src/Test/Hspec/HUnit.hs 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -module Test.Hspec.HUnit {-# DEPRECATED "use \"Test.Hspec.Contrib.HUnit\" from package @hspec-contrib@ instead" #-} -( --- * Interoperability with HUnit - fromHUnitTest -) where - -import Test.Hspec.Core.Spec -import Test.HUnit (Test (..)) - --- | --- Convert a HUnit test suite to a spec. This can be used to run existing --- HUnit tests with Hspec. -fromHUnitTest :: Test -> Spec -fromHUnitTest t = case t of - TestList xs -> mapM_ go xs - x -> go x - where - go :: Test -> Spec - go t_ = case t_ of - TestLabel s (TestCase e) -> it s e - TestLabel s (TestList xs) -> describe s (mapM_ go xs) - TestLabel s x -> describe s (go x) - TestList xs -> describe "<unlabeled>" (mapM_ go xs) - TestCase e -> it "<unlabeled>" e diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/test/Helper.hs new/hspec-2.5.0/test/Helper.hs --- old/hspec-2.4.4/test/Helper.hs 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/test/Helper.hs 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -module Helper ( - module Test.Hspec.Meta -, withFileContent -) where - -import Control.Exception (finally) -import System.Directory -import System.IO -import Test.Hspec.Meta - -import Test.Hspec.QuickCheck () - -withFileContent :: String -> (FilePath -> IO a) -> IO a -withFileContent input action = do - dir <- getTemporaryDirectory - (file, h) <- openTempFile dir "temp" - hPutStr h input - hClose h - action file `finally` removeFile file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/test/HelperSpec.hs new/hspec-2.5.0/test/HelperSpec.hs --- old/hspec-2.4.4/test/HelperSpec.hs 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/test/HelperSpec.hs 1970-01-01 01:00:00.000000000 +0100 @@ -1,18 +0,0 @@ -module HelperSpec (main, spec) where - -import Helper -import System.IO.Error (isDoesNotExistError) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "withFileContent" $ do - it "creates a file with specified content and runs specified action" $ do - withFileContent "foo" $ \file -> do - readFile file `shouldReturn` "foo" - - it "removes file after action has been run" $ do - file <- withFileContent "foo" return - readFile file `shouldThrow` isDoesNotExistError diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hspec-2.4.4/test/Test/Hspec/DiscoverSpec.hs new/hspec-2.5.0/test/Test/Hspec/DiscoverSpec.hs --- old/hspec-2.4.4/test/Test/Hspec/DiscoverSpec.hs 2017-06-16 11:08:37.000000000 +0200 +++ new/hspec-2.5.0/test/Test/Hspec/DiscoverSpec.hs 1970-01-01 01:00:00.000000000 +0100 @@ -1,74 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# OPTIONS_GHC -fno-warn-deprecations #-} -module Test.Hspec.DiscoverSpec (main, spec) where - -import Helper -import Data.String -import Data.String.Builder - -import qualified Test.Hspec.Core.Spec as H -import Test.Hspec.Core (Tree(..), Item(..), Location(..), LocationAccuracy(..), runSpecM) -import qualified Test.Hspec.Discover as H - -infix 1 `shouldHaveLocation` - -shouldHaveLocation :: Item a -> (String, Int) -> Expectation -item `shouldHaveLocation` (src, line) = itemLocation item `shouldBe` Just (Location src line 0 BestEffort) - -removeLocations :: H.SpecWith a -> H.SpecWith a -removeLocations = H.mapSpecItem_ (\item -> item{H.itemLocation = Nothing}) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "postProcessSpec" $ do - it "adds heuristic source locations" $ do - let c = build $ do - "" - strlit "foo" - "" - strlit "bar" - "" - strlit "baz" - withFileContent c $ \src -> do - [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do - H.it "foo" True - H.it "bar" True - H.it "baz" True - item1 `shouldHaveLocation` (src, 2) - item2 `shouldHaveLocation` (src, 4) - item3 `shouldHaveLocation` (src, 6) - - context "when same requirement is used multiple times" $ do - it "assigns locations sequentially" $ do - let c = build $ do - strlit "foo" - strlit "foo" - strlit "foo" - withFileContent c $ \src -> do - [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do - H.it "foo" True - H.it "foo" True - H.it "foo" True - item1 `shouldHaveLocation` (src, 1) - item2 `shouldHaveLocation` (src, 2) - item3 `shouldHaveLocation` (src, 3) - - context "when a requirement occurs more often in the spec tree than in the source file" $ do - it "assigns Nothing" $ do - let c = build $ do - strlit "foo" - strlit "foo" - withFileContent c $ \src -> do - [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do - H.it "foo" True - H.it "foo" True - H.it "foo" True - itemLocation item1 `shouldBe` Nothing - itemLocation item2 `shouldBe` Nothing - itemLocation item3 `shouldBe` Nothing - where - strlit :: String -> Builder - strlit = fromString . show