fscheck / FsCheck

Random Testing for .NET
https://fscheck.github.io/FsCheck/
BSD 3-Clause "New" or "Revised" License
1.17k stars 156 forks source link

Generates negative decimal values #646

Closed sasmithjr closed 12 months ago

sasmithjr commented 12 months ago

Heya! When writing some tests with FsCheck yesterday, I discovered the tests taking forever because Gen.filter (fun d -> d <= 0) for decimals was never satisfying the predicate.

I copied how negative values are created for NormalFloat.

I added a test that uses the above filter to make sure negative values are generated. If there's a regression that reverts back to previous behavior (i.e. only generating positive decimals), this test will "fail" by hitting a timeout in CI. Is that okay?

Thank you for the great library, and have a great weekend!

kurtschelfthout commented 12 months ago

LGTM, thanks!