tasty-discover 5.0.1 → 5.0.2
raw patch · 6 files changed
+16/−9 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Tasty.Discover.Internal.Config: instance GHC.Generics.Generic Test.Tasty.Discover.Internal.Config.Config
+ Test.Tasty.Discover.Internal.Generator: instance GHC.Generics.Generic Test.Tasty.Discover.Internal.Generator.Generator
+ Test.Tasty.Discover.Internal.Generator: instance GHC.Generics.Generic Test.Tasty.Discover.Internal.Generator.Test
+ Test.Tasty.Discover.TastyInfo: instance GHC.Generics.Generic Test.Tasty.Discover.TastyInfo.TastyInfo
Files
- src/Test/Tasty/Discover.hs +4/−2
- src/Test/Tasty/Discover/Internal/Config.hs +2/−1
- src/Test/Tasty/Discover/Internal/Generator.hs +3/−2
- src/Test/Tasty/Discover/TastyInfo.hs +2/−1
- tasty-discover.cabal +3/−2
- test/DiscoverTest.hs +2/−1
src/Test/Tasty/Discover.hs view
@@ -32,10 +32,12 @@ tasty info a = TT.testGroup (descriptionOf info) <$> a nameOf :: TastyInfo -> String-nameOf info = (fromMaybe "<unnamed>" (getLast (TI.name info)))+nameOf info =+ fromMaybe "<unnamed>" (getLast (TI.name info)) descriptionOf :: TastyInfo -> String-descriptionOf info = (fromMaybe "<undescribed>" (getLast (TI.description info)))+descriptionOf info =+ fromMaybe "<undescribed>" (getLast (TI.description info)) name :: String -> TastyInfo name n = mempty
src/Test/Tasty/Discover/Internal/Config.hs view
@@ -16,6 +16,7 @@ ) where import Data.Maybe (isJust)+import GHC.Generics (Generic) import System.Console.GetOpt (ArgDescr (NoArg, ReqArg), ArgOrder (Permute), OptDescr (Option), getOpt') import System.FilePath ((</>)) @@ -39,7 +40,7 @@ , noModuleSuffix :: Bool -- ^ <<<DEPRECATED>>>: suffix and look in all modules. , debug :: Bool -- ^ Debug the generated module. , treeDisplay :: Bool -- ^ Tree display for the test results table.- } deriving stock (Show)+ } deriving stock (Show, Generic) -- | The default configuration defaultConfig :: FilePath -> Config
src/Test/Tasty/Discover/Internal/Generator.hs view
@@ -25,13 +25,14 @@ import Data.Function (on) import Data.List (find, groupBy, isPrefixOf, sortOn) import Data.Maybe (fromJust)+import GHC.Generics (Generic) import System.FilePath (dropExtension, isPathSeparator) -- | The test type. data Test = Test { testModule :: String -- ^ Module name. , testFunction :: String -- ^ Function name.- } deriving stock (Eq, Show, Ord)+ } deriving stock (Eq, Show, Generic, Ord) -- | 'Test' constructor. mkTest :: FilePath -> String -> Test@@ -44,7 +45,7 @@ , generatorImports :: [String] -- ^ Module import path. , generatorClass :: String -- ^ Generator class. , generatorSetup :: Test -> String -- ^ Generator setup.- }+ } deriving (Generic) -- | Module import qualifier. qualifyFunction :: Test -> String
src/Test/Tasty/Discover/TastyInfo.hs view
@@ -3,11 +3,12 @@ ) where import Data.Monoid+import GHC.Generics (Generic) data TastyInfo = TastyInfo { name :: Last String , description :: Last String- } deriving stock (Eq, Show)+ } deriving stock (Eq, Show, Generic) instance Semigroup TastyInfo where a <> b = TastyInfo
tasty-discover.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: tasty-discover-version: 5.0.1+version: 5.0.2 synopsis: Test discovery for the tasty framework. description: Automatic test discovery and runner for the tasty framework. @@ -57,7 +57,8 @@ common tasty-smallcheck { build-depends: tasty-smallcheck >= 0.8 && < 1.0 } common project-config- default-extensions: DerivingStrategies+ default-extensions: DeriveGeneric+ DerivingStrategies if (impl(ghc >= 9.2.1)) default-extensions: OverloadedRecordDot ghc-options: -Wall
test/DiscoverTest.hs view
@@ -1,13 +1,13 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TypeApplications #-} module DiscoverTest where import Data.ByteString.Lazy (ByteString) import Data.List import Data.String (IsString(..))+import GHC.Generics (Generic) import Test.Hspec (shouldBe) import Test.Hspec.Core.Spec (Spec, describe, it) import Test.Tasty@@ -105,6 +105,7 @@ -- How to add custom support for golden tests. data GoldenTest = GoldenTest FilePath (IO ByteString)+ deriving stock (Generic) instance TD.Tasty GoldenTest where tasty info (GoldenTest fp act) = pure $ goldenVsString (TD.descriptionOf info) fp act