Closed AlexBaranosky closed 11 years ago
All looks great on first glance, will take a look in a bit more detail later this evening or tomorrow. Thanks!
What do you think about a default of 1000 times instead of 100? Will that encourage people to write quicker-running tests?
The reason why I didn't provide a default in the first place is that per-test runtimes do vary, sometimes significantly, or what anyone might want to achieve in a default configuration (i.e. maybe they want lein test
to be quick, maybe they want the default to be incredibly thorough). Maybe that's not clear-headed thinking, but FWIW, etc.
@cemerick I'm leaning to just removing the default.
Both the Haskell and Erlang QC successfully (imho) use a default number of times. I care less about there being a default in the clojure.test macro (defspec
) though than I care about there being one in simple-check.core/quickcheck
, because I'm more likely to be playing with the latter in the REPL.
For lack of a better place to put this idea. I was wondering:
such-that
a function that has the same name in the Haskell/Erlang QuickChecks? partial
or ->>
?gen/filter
? Not sure if I love or hate this idea. It seems nice to think of filtering over the Generator context, much like you've got the return
/fmap
/bind
operations.is such-that is a function that draws meaning from the Haskell/Erlang QuickChecks?
Yes, it's in both. Here's the Haskell documentation about it. Though I agree it'd be easier with the args reversed for partial application. I'm also kind of on the fence about the name change.
@reiddraper want me to put the default back at 1000?
Added ::defspec
metadata to each test var. Enables me to add this to my project.clj
:test-selectors {:default (fn [v] true)
:specs :simple-check.clojure-test/defspec}
and be able to run only the defspecs:
> lein test :specs
mind you if you do renamed defspec
to defproperty
, this metadata should probably change to ::property
.
@cemerick any objection to swapping the order of defspec
args like this?
@reiddraper I don't think so, no.
Here for you to take a look at. Willing to discuss/debate merits of any of this stuff. Reverting is easy enough.