0.4.3 #274
nth-commit
announced in
Announcements
0.4.3
#274
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Rendering improvements
This release greatly improves how counterexamples are printed when a property is falsified, as well as how samples are printed when using
[Sample]
. Previously, GalaxyCheck would render examples usingSystem.Text.Json.JsonSerializer
. This constrained rendering in to the JSON format, which is more verbose and strict than it needs to be for this purpose.This constrained us in several ways. For example (but not limited to):
Other improvements are outlined in the tests.
This also removes the external dependency on
System.Text.Json
, which is not included in netstandard2.0.Falsified stack traces are now of the user's code
An intrinsic part of GalaxyCheck (and most other property-based testing frameworks) is about finding the smallest counterexample to a property. A property will normally be run many times after it initially fails, as the input to each test case gets smaller.
This means that exceptions can't be directly bubbled back to the user. GalaxyCheck needs to intercept exceptions, hold onto them, then eventually return the exception that was associated with the smallest counterexample. Naturally, this is destructive to stack traces - and meant that in earlier versions of GalaxyCheck, when viewing the test output for a falsified property, you would see a stack trace for code inside GalaxyCheck itself.
This release improves upon that by augmenting GalaxyCheck's
PropertyFailedException
, with the stack trace of the exception from the user's code (if there was one).Shrink limit is always respected
When specifying a property, you can configure the shrink limit, e.g.
[Property(ShrinkLimit = 10)]
. This is a good way to put a hard limit on the amount of time GalaxyCheck can spend finding the smallest counterexample, and by default it's set at 500.However, GalaxyCheck didn't always respect that limit, which meant for things that are hard to shrink, GalaxyCheck could spend an inappropriate amount of time spinning on. This release fixes that.
More run parameters exposed through
PropertyAttribute
PropertyAttribute adds
Seed
andSize
, which allows you to tightly control generation upfront. Useful for debugging.This discussion was created from the release 0.4.3.
Beta Was this translation helpful? Give feedback.
All reactions