quickcheck-silent 0.11.0.15 → 0.11.0.16
raw patch · 3 files changed
+27/−23 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Test.QuickCheck.Silent: quickCheckSilentSuite :: Char -> String -> Test -> IO [(Label, Result)]
+ Test.QuickCheck.Silent: quickCheckSilentSuite :: Char -> [String] -> Test -> IO [(Label, Result)]
- Test.QuickCheck.Silent: quickCheckSilentSuiteJSON :: Char -> String -> Test -> IO [JSON]
+ Test.QuickCheck.Silent: quickCheckSilentSuiteJSON :: Char -> [String] -> Test -> IO [JSON]
Files
- CHANGELOG.md +7/−0
- quickcheck-silent.cabal +1/−1
- src/Test/QuickCheck/Silent.hs +19/−22
CHANGELOG.md view
@@ -1,5 +1,12 @@ # Revision history for quickcheck-silent +## 0.11.0.16 -- 2026-08-20++* Updated `quickCheckSilentSuiteJSON` documentation.++* Refactored `quickCheckSilentSuite` and `quickCheckSilentSuiteJSON` to take a+ list of patterns (`pts`) instead of a single (`pat`).+ ## 0.11.0.15 -- 2026-08-20 * Moved the `JSON` type below `Result` and refactored code based on `LSP`
quickcheck-silent.cabal view
@@ -10,7 +10,7 @@ build-type: Simple name: quickcheck-silent-version: 0.11.0.15+version: 0.11.0.16 synopsis: Testing with QuickCheck in silence description: Testing with QuickCheck in silence. For more info see README.md
src/Test/QuickCheck/Silent.hs view
@@ -162,7 +162,7 @@ :: [SilentProp] -> IO [Result] quickCheckSilent =- mapM (\ p -> (aux . property) p >>= pure . resultAux)+ mapM (\ p -> resultAux <$> (aux . property) p) where aux = QC.quickCheckWithResult $ stdArgs { chatty = False }@@ -173,10 +173,10 @@ -- For example, -- -- > check =--- > quickCheckSilentSuite sep pat tcs+-- > quickCheckSilentSuite sep pts tcs -- > where -- > sep = '.'--- > pat = "Test.QuickCheck.Silent"+-- > pts = [ "Test.QuickCheck.Silent" ] -- > tcs = -- > Group "Test" -- > [ Group "QuickCheck"@@ -192,25 +192,25 @@ -- -- will test both @p@ and @q@, but not @r@. ----- The provided @pattern@, will be checked if it 'Data.List.isPrefixOf' of each--- @label@:+-- The provided @patterns@, will be checked if they are a 'Data.List.isPrefixOf'+-- of each @label@: ----- > pattern `isPrefixOf` label+-- > any (`isPrefixOf` label) [ pattern_0, pattern_1, … pattern_n ] ----- @NOTE@: To test all cases, just provide an empty string as @pattern@ as it's--- a prefix for all possible @labels@.+-- @NOTE@: To test all cases, just provide a singleton list with an empty string+-- element as @pattern@ as it's a prefix for all possible @labels@. quickCheckSilentSuite :: Char- -> String+ -> [String] -> Test -> IO [(Label, Result)]-quickCheckSilentSuite sep pat suite =+quickCheckSilentSuite sep pts suite = mapM ( \ (l, sp) -> (aux . property) sp >>= \ r -> pure (l, resultAux r) )- $ filter ( \(l, _) -> pat `isPrefixOf` l)+ $ filter ( \(l, _) -> any (`isPrefixOf` l) pts) $ dfs [] suite where dfs [ ] (Group l ts) = concatMap (dfs l) ts@@ -220,22 +220,19 @@ aux = QC.quickCheckWithResult $ stdArgs { chatty = False } --- | Same behavior as 'quickCheckSilentSuite', but, producing a 'JSON' data--- payload instead.+-- | Same behavior as 'quickCheckSilentSuite', but, producing a list of 'JSON'+-- data payloads instead. quickCheckSilentSuiteJSON :: Char- -> String+ -> [String] -> Test -> IO [JSON]-quickCheckSilentSuiteJSON sep pat suite =- ( \ lrs ->- map- ( \ (l, r) ->- encodeJSON $ LabelResultJSON l r- )- lrs+quickCheckSilentSuiteJSON sep pts suite =+ map+ ( \ (l, r) ->+ encodeJSON $ LabelResultJSON l r )- <$> quickCheckSilentSuite sep pat suite+ <$> quickCheckSilentSuite sep pts suite -- | Check if the test run result was a success isSuccess :: Result -> Bool