quickcheck-silent 0.11.0.12 → 0.11.0.13
raw patch · 3 files changed
+76/−34 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Test.QuickCheck.Silent: [numShrinkFinal] :: Result -> !Int
+ Test.QuickCheck.Silent: [numShrinkTries] :: Result -> !Int
+ Test.QuickCheck.Silent: [numShrinks] :: Result -> !Int
+ Test.QuickCheck.Silent: [theException] :: Result -> !String
+ Test.QuickCheck.Silent: [usedSeed] :: Result -> !String
+ Test.QuickCheck.Silent: [usedSize] :: Result -> !Int
- Test.QuickCheck.Silent: Result :: !Status -> !Int -> !Int -> !String -> !String -> Result
+ Test.QuickCheck.Silent: Result :: !Status -> !Int -> !Int -> !Int -> !Int -> !Int -> !String -> !Int -> !String -> !String -> !String -> Result
Files
- CHANGELOG.md +8/−3
- quickcheck-silent.cabal +1/−1
- src/Test/QuickCheck/Silent.hs +67/−30
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for quickcheck-silent +## 0.11.0.13 -- 2026-08-19++* Expanded the `Result` product type: `numShrinks`, `numShrinkTries`,+ `numShrinkFinal`, `usedSeed`, `usedSize` and `theException` fields.+ ## 0.11.0.12 -- 2026-08-18 * Deriving `Show` for `Status` instead of implementing a custom instance.@@ -25,9 +30,9 @@ `case`. * Exposing `property` in order to re-use defined silent property test cases with- other compatible `QuickChech` frameworks.+ other compatible `QuickCheck` frameworks. -* Dropped the `Result` data type from `QuickChech` as it's a bit complex. A more+* Dropped the `Result` data type from `QuickCheck` as it's a bit complex. A more simple, heavily inspired in the `Count` type from the `HUnit` package has been added. @@ -121,7 +126,7 @@ ## 0.11.0.4 -- 2026-08-07 -* Re-exporting `Test.QuickChech.Result` to avoid dependency on the `QuickChech`+* Re-exporting `Test.QuickCheck.Result` to avoid dependency on the `QuickCheck` package ## 0.11.0.3 -- 2026-08-07
quickcheck-silent.cabal view
@@ -10,7 +10,7 @@ build-type: Simple name: quickcheck-silent-version: 0.11.0.12+version: 0.11.0.13 synopsis: Testing with QuickCheck in silence description: Testing with QuickCheck in silence. For more info see README.md
src/Test/QuickCheck/Silent.hs view
@@ -41,6 +41,7 @@ import Data.Data ( Data ) import Data.List ( isPrefixOf )+import Data.Maybe ( fromMaybe ) import qualified Test.QuickCheck as QC import Test.QuickCheck@@ -90,16 +91,28 @@ -- | Result represents the test result data Result = Result- { status :: !Status+ { status :: !Status -- ^ Outcome of the test- , numTests :: !Int+ , numTests :: !Int -- ^ Number of tests performed- , numDiscarded :: !Int+ , numDiscarded :: !Int -- ^ Number of tests skipped- , output :: !String+ , numShrinks :: !Int+ -- ^ Number of successful shrinking steps performed+ , numShrinkTries :: !Int+ -- ^ Number of unsuccessful shrinking steps performed+ , numShrinkFinal :: !Int+ -- ^ Number of unsuccessful shrinking steps performed since last successful shrink+ , usedSeed :: !String+ -- ^ What seed was used+ , usedSize :: !Int+ -- ^ What was the test size+ , output :: !String -- ^ Non-printed output- , reason :: !String+ , reason :: !String -- ^ If the property failed, why?+ , theException :: !String+ -- ^ The exception the property threw, if any } deriving (Data, Show) @@ -150,7 +163,7 @@ :: [SilentProp] -> IO [Result] quickCheckSilent =- mapM (\ p -> (aux . property) p >>= pure . result_)+ mapM (\ p -> (aux . property) p >>= pure . resultAux) where aux = QC.quickCheckWithResult $ stdArgs { chatty = False }@@ -196,7 +209,7 @@ mapM ( \ (l, sp) -> (aux . property) sp >>= \ r ->- pure (l, result_ r)+ pure (l, resultAux r) ) $ filter ( \(l, _) -> pat `isPrefixOf` l) $ dfs [] suite@@ -234,40 +247,64 @@ -- HELPERS -result_+resultAux :: QC.Result -> Result-result_ res =+resultAux res = case res of QC.Success t d _ _ _ o -> Result- { status = Success- , Test.QuickCheck.Silent.numTests = t- , Test.QuickCheck.Silent.numDiscarded = d- , Test.QuickCheck.Silent.output = o- , Test.QuickCheck.Silent.reason = []+ { status = Success+ , Test.QuickCheck.Silent.numTests = t+ , Test.QuickCheck.Silent.numDiscarded = d+ , Test.QuickCheck.Silent.numShrinks = 0+ , Test.QuickCheck.Silent.numShrinkTries = 0+ , Test.QuickCheck.Silent.numShrinkFinal = 0+ , Test.QuickCheck.Silent.usedSeed = []+ , Test.QuickCheck.Silent.usedSize = 0+ , Test.QuickCheck.Silent.output = o+ , Test.QuickCheck.Silent.reason = []+ , Test.QuickCheck.Silent.theException = [] } QC.GaveUp t d _ _ _ o -> Result- { status = Desisted- , Test.QuickCheck.Silent.numTests = t- , Test.QuickCheck.Silent.numDiscarded = d- , Test.QuickCheck.Silent.output = o- , Test.QuickCheck.Silent.reason = []+ { status = Desisted+ , Test.QuickCheck.Silent.numTests = t+ , Test.QuickCheck.Silent.numDiscarded = d+ , Test.QuickCheck.Silent.numShrinks = 0+ , Test.QuickCheck.Silent.numShrinkTries = 0+ , Test.QuickCheck.Silent.numShrinkFinal = 0+ , Test.QuickCheck.Silent.usedSeed = []+ , Test.QuickCheck.Silent.usedSize = 0+ , Test.QuickCheck.Silent.output = o+ , Test.QuickCheck.Silent.reason = []+ , Test.QuickCheck.Silent.theException = [] }- QC.Failure t d _ _ _ _ _ r _ o _ _ _ _ ->+ QC.Failure t d ss st sf se si r e o _ _ _ _ -> Result- { status = Failure- , Test.QuickCheck.Silent.numTests = t- , Test.QuickCheck.Silent.numDiscarded = d- , Test.QuickCheck.Silent.output = o- , Test.QuickCheck.Silent.reason = r+ { status = Failure+ , Test.QuickCheck.Silent.numTests = t+ , Test.QuickCheck.Silent.numDiscarded = d+ , Test.QuickCheck.Silent.numShrinks = ss+ , Test.QuickCheck.Silent.numShrinkTries = st+ , Test.QuickCheck.Silent.numShrinkFinal = sf+ , Test.QuickCheck.Silent.usedSeed = show se+ , Test.QuickCheck.Silent.usedSize = si+ , Test.QuickCheck.Silent.output = o+ , Test.QuickCheck.Silent.reason = r+ , Test.QuickCheck.Silent.theException = fromMaybe [] $ show <$> e } QC.NoExpectedFailure t d _ _ _ o -> Result- { status = NoFailure- , Test.QuickCheck.Silent.numTests = t- , Test.QuickCheck.Silent.numDiscarded = d- , Test.QuickCheck.Silent.output = o- , Test.QuickCheck.Silent.reason = []+ { status = NoFailure+ , Test.QuickCheck.Silent.numTests = t+ , Test.QuickCheck.Silent.numDiscarded = d+ , Test.QuickCheck.Silent.numShrinks = 0+ , Test.QuickCheck.Silent.numShrinkTries = 0+ , Test.QuickCheck.Silent.numShrinkFinal = 0+ , Test.QuickCheck.Silent.usedSeed = []+ , Test.QuickCheck.Silent.usedSize = 0+ , Test.QuickCheck.Silent.output = o+ , Test.QuickCheck.Silent.reason = []+ , Test.QuickCheck.Silent.theException = [] }