-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests without generators #121
Comments
I’d typically use the “once” function to just run a property that doesn’t
use generators. Though it doesn’t seem the function is in hedgehog like it
was in Jack.
Not sure about adding detection of tests that don’t use generator.
…On Fri, 6 Oct 2017 at 6:17 am, Chris Martin ***@***.***> wrote:
So, Hedgehog is a property testing library, yes, but - It's also just a
really great general-purpose test runner, and I've been using it for things
that aren't actually property tests. The downside is that my tests run a
hundred times, when they only need to run once.
Is there a quick way to modify a property so that it only checks *once*?
And, I don't know if this is reasonable to ask, but: Could Hedgehog be
clever enough to detect whether a property ever uses a generator, and only
recheck if it does?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#121>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAKbuQKbD8eF5gSF3tj-RIy7Y9P7Y8TCks5spStfgaJpZM4PvkSl>
.
|
The combinator is
|
Cheers, I thought it'd be there somewhere.
…On Fri, Oct 6, 2017 at 7:59 AM, Nick Hibberd ***@***.***> wrote:
The combinator is withTests 1, e.g. https://github.com/hedgehogqa/
haskell-hedgehog/blob/d12b3e8d2150cd51e4ea89b1bb1727
a3beceed2f/hedgehog-example/test/Test/Example/Basic.hs#L42
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#121 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKbuTztZOUjfA5Hu3KlyiBafcfWs_Mnks5spUMsgaJpZM4PvkSl>
.
|
Why not make |
I guess I figured having |
I can imagine this could possibly be added in to the |
I don't mind not having a |
Yeah I completely agree |
Fwiw, I would add |
Having once seems pretty special case to me. Having better discoverability
on the right way to do this in hedgehog would be better IMHO
…On Fri, 6 Oct 2017 at 9:21 am, Jacob Stanley ***@***.***> wrote:
Fwiw, I would add once if enough people wanted it, but I've been trying
to keep the API as thin as possible initially so that we don't grow a bunch
of unnecessary functions that end up not being widely used.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#121 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKbufLM5SfOPTNXv3ADgUs2tS8RBF-Zks5spVZwgaJpZM4PvkSl>
.
|
Just found this issue while wondering the same. To me, something like the I'm a big proponent of property-based testing, but in practice I continue to write a lot of example-based tests, so from my perspective its quite valuable for this not to be too awkward to achieve. (Background: I use Hedgehog a lot at work (we're quite happy with it!) where we have some utility definitions that accomplish this. Now I'm adding it to a personal project and noticing this as a friction/confusion point.) |
👍 😍
🤔 say we add In 88% of the cases we do come up with some utility functions, and I think that's where In general though, just exposing a single way of doing things makes the API easier to learn for newcomers, and (often) explicit is better than implicit. |
So, Hedgehog is a property testing library, yes, but - It's also just a really great general-purpose test runner, and I've been using it for things that aren't actually property tests. The downside is that my tests run a hundred times, when they only need to run once.
Is there a quick way to modify a property so that it only checks once?
And, I don't know if this is reasonable to ask, but: Could Hedgehog be clever enough to detect whether a property ever uses a generator, and only recheck if it does?
The text was updated successfully, but these errors were encountered: