tasty 1.4.0.3 → 1.4.1
raw patch · 4 files changed
+23/−4 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +6/−0
- Test/Tasty/Ingredients.hs +2/−2
- Test/Tasty/Options.hs +13/−0
- tasty.cabal +2/−2
CHANGELOG.md view
@@ -1,6 +1,12 @@ Changes ======= +Version 1.4.1+-------------++Deduplicate command line options when there is more than one TestReporter.+Expose the function that does that, `uniqueOptionDescriptions`.+ Version 1.4.0.3 ---------------
Test/Tasty/Ingredients.hs view
@@ -112,12 +112,12 @@ -- | Like 'ingredientOption', but folds over multiple ingredients. ingredientsOptions :: [Ingredient] -> [OptionDescription]-ingredientsOptions = F.foldMap ingredientOptions+ingredientsOptions = uniqueOptionDescriptions . F.foldMap ingredientOptions -- | All the options relevant for this test suite. This includes the -- options for the test tree and ingredients, and the core options. suiteOptions :: [Ingredient] -> TestTree -> [OptionDescription]-suiteOptions ins tree =+suiteOptions ins tree = uniqueOptionDescriptions $ coreOptions ++ ingredientsOptions ins ++ treeOptions tree
Test/Tasty/Options.hs view
@@ -15,6 +15,7 @@ , lookupOption , singleOption , OptionDescription(..)+ , uniqueOptionDescriptions -- * Utilities , flagCLParser , mkFlagCLParser@@ -32,6 +33,7 @@ import Data.Typeable import Data.Monoid import Data.Foldable+import qualified Data.Set as S import Prelude hiding (mod) -- Silence FTP import warnings import Options.Applicative #if !MIN_VERSION_base(4,11,0)@@ -128,6 +130,17 @@ -- corresponding to a particular option. data OptionDescription where Option :: IsOption v => Proxy v -> OptionDescription++-- | Remove duplicated 'OptionDescription', preserving existing order otherwise+--+-- @since 1.4.1+uniqueOptionDescriptions :: [OptionDescription] -> [OptionDescription]+uniqueOptionDescriptions = go S.empty+ where+ go _ [] = []+ go acc (Option o : os)+ | typeOf o `S.member` acc = go acc os+ | otherwise = Option o : go (S.insert (typeOf o) acc) os -- | Command-line parser to use with flags flagCLParser
tasty.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: tasty-version: 1.4.0.3+version: 1.4.1 synopsis: Modern and extensible testing framework description: Tasty is a modern testing framework for Haskell. It lets you combine your unit tests, golden@@ -65,7 +65,7 @@ Test.Tasty.Ingredients.ListTests Test.Tasty.Ingredients.IncludingOptions build-depends:- base >= 4.7 && < 5,+ base >= 4.8 && < 5, stm >= 2.3, containers, mtl >= 2.1.3.1,