From 40cbf989cde80da86ad3db0cdd65bd4cbbd96458 Mon Sep 17 00:00:00 2001 From: Calum Sieppert Date: Mon, 16 Dec 2024 15:47:03 -0700 Subject: [PATCH] Show number of tests and stamps on fscheck test pass --- Expecto.FsCheck/FsCheck.fs | 6 +++++- RELEASE_NOTES.md | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Expecto.FsCheck/FsCheck.fs b/Expecto.FsCheck/FsCheck.fs index 823babd..5a7d02c 100644 --- a/Expecto.FsCheck/FsCheck.fs +++ b/Expecto.FsCheck/FsCheck.fs @@ -42,7 +42,11 @@ module ExpectoFsCheck = | xs -> sprintf "%s\n" (String.concat "\n" xs) match testResult with - | TestResult.True (_testData,_b) -> () + | TestResult.True (data,suppressOutput) -> + if not suppressOutput then + $"Passed {numTests data.NumberOfTests}.\n{stampsToString data.Stamps}" + |> PassWithMessage + |> raise | TestResult.False (_,_,_, Outcome.Exception (:? IgnoreException as e),_) -> raise e diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8bf3a3f..5361f80 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,8 @@ ### 11.0.0-alpha4 - 2024-12-16 -* Allow quietOnSuccess and maxRejected fscheck config * Tests can now pass with a message - * `TestPrinters` now has a new field `passedWithMessage` which may need to be implemented for custom printers + * `TestPrinters` now has a new field `passedWithMessage` which may need to be implemented for custom printers +* Allow quietOnSuccess and maxRejected fscheck config + * When `quietOnSuccess` is false, the number of tests and stamps (`Prop.collect/classify/trivial` etc) will be shown when the test passes. ### 11.0.0-alpha3 - 2024-10-13 * Add testParamAsync and testParamTask (#512), thanks @1eyewonder