Typically you don't write test.check generators like this. You'll build up
a generator using the test.check generator combinators. You can see some
examples of this in the
documentation: https://github.com/clojure/test.check/blob/master/doc/intro.md.
Reid
On Wednesday, December 10, 2014 12:22:
Short answer:
Use a string generator that is much more likely to have collisions, and
thus provoke your failure. Here's an example:
(def small-strings (gen/sized (fn [s] (gen/resize (min s 2) (gen/not-empty
gen/string-ascii)
Longer answer:
When using gen/bind, you create a nested shrink t
. Where
>> were you expecting feedback? When I have questions about a project like
>> this, I'm never sure where to ask them. Stackoverflow? A github issue?
>> Google groups? Anyway it looks pretty cool to my untrained eye but I'd be
>> interested in hearing
Hey Tim,
When you write a property, like your `has-agroup`, there's no need to call
`gen/sample`. You can simply write: (prop/for-all [v my-generator] ...)
-Reid
On Sunday, August 10, 2014 6:04:21 PM UTC-5, frye wrote:
>
> Oook, this is starting to sink in.
>
> I've gotten a little farther, in
I'm happy to announce the 0.5.9 release of clojure.test.check, a QuickCheck
inspired property-based testing library [1]. As usual, you can view the
release notes [2]. The biggest change is an improvement to writing
recursive generators, which is documented here [3].
Happy testing,
Reid
[1] htt
Hi,
I've taken a stab at what I think you want:
(def gen-cache
(gen/fmap
#(reduce (fn [r m] (merge-with merge r m)) {} %)
(gen/vector (gen/fmap
(fn [o]
(let [{:keys [port instr] :as ord} o]
(assoc-in {} [port instr] ord)))
Hi Colin,
You've correctly followed the guide for writing recursive generators.
Trouble is, the guide (which I wrote) is wrong! I'll work on getting it
updated shortly, but in the interim, you can check out the detailed commit
message
here:
https://github.com/clojure/test.check/commit/2a2bd8f
On May 15, 2014, at 2:08 PM, Steve Miner wrote:
> I'm generating generators from schemas [1]. I have generators for all my
> simple schemas -- "int" corresponds to gen/int, etc. The tougher case is
> when I have to convert a conjunction of schema expressions into a generator.
> For example,
. Happy to help
explore other ways to write these generators.
Best,
Reid
On Wednesday, May 14, 2014 12:13:14 PM UTC-5, miner wrote:
>
>
> On May 14, 2014, at 10:44 AM, Reid Draper >
> wrote:
> > * Limit the number of retries for gen/such-that. A two-arity version
> is
I'm please to announce clojure.test.check 0.5.8 [1], which is primarily a
bugfix release. As usual, the release notes are available in the repository
[2]. I've duplicated them here for convenience:
* 0.5.8
* Limit the number of retries for gen/such-that. A two-arity version is
provided
Keep in mind too that since test.check/quick-check takes a property as an
argument, you can construct a property by simply closing over some
implementation. For example:
(defn make-prop
[impl]
(prop/for-all [...]
(= (impl ...) (other ...)))
And then test with different properties create
Hi Brian,
clojure.test.check does not currently ship with any concurrency support.
That being said, I've been working an implementation on Erlang's PULSE,
which I hope to have usable in the next couple months [1][2]. John's talk
touches on using state machines to test concurrent code, which is
used) [4]. Obviously, it makes using
> property-testing a lot easier.
> -support for generator statistics — what instances was generated, what was
> the distribution of test sizes and so on.
> In this project, if it will be selected, I will implement this three
> features
test.check.properties :as prop]
> ))
>
> (defn format1 [x]
> (try
> (->> (double x)
> (format "%,.0f"))
> (catch Exception e "")))
>
> (def prop1
> (prop/for-all [v gen/any]
> (string? (format1 v
>
I'm happy to announce the first release of the newest Clojure contrib
library:
test.check [1]. Previously named simple-check [1], test.check is a
property-based testing library, based on QuickCheck. The README has a guide
for
migrating from simple-check, as well as some getting-started documentat
Thanks for reporting. This was introduced in 0.5.4, and I've pushed a fixed
release as 0.5.6.
On Saturday, January 25, 2014 7:50:19 PM UTC-6, Jean Niklas L'orange wrote:
>
>
>
> On Saturday, January 25, 2014 10:03:13 PM UTC+1, Michael Daines wrote:
>>
>> I decided to play with simple-check for th
On Jul 17, 2013, at 12:56 AM, Alex Baranosky
wrote:
> Hi Reid,
>
> I dig how nicely it integrates with clojure.test. Does simple-check
> implement some form of shrinking?
It does. The README has an example of the output when a property fails (and the
input is shrunk), but it's also easy to
Derp, I fat-fingered my own library name in the subject :)
On Tuesday, July 16, 2013 2:18:54 PM UTC-5, Reid Draper wrote:
>
> I'm happy to announce the first non-snapshot version (0.1.0) of
> simple-check, a QuickCheck inspired testing tool:
> https://github.com/reiddr
I'm happy to announce the first non-snapshot version (0.1.0) of
simple-check, a QuickCheck inspired testing
tool: https://github.com/reiddraper/simple-check.
simple-check is a fairly faithful port of a subset of Haskell's QuickCheck,
with some additional inspiration from Erlang QuickCheck. With
On Monday, July 15, 2013 9:41:03 AM UTC-5, Andreas Liljeqvist wrote:
>
> Hi, I have taken a look at simple-check.
>
> Seems promising, but I have a few reservations:
>
> I want to constrain the generation of two vectors to always have the same
> number of elements as the other one.
> From what I
On Monday, March 26, 2012 5:19:30 PM UTC-4, David Nolen wrote:
>
> On Mon, Mar 26, 2012 at 5:10 PM, Reid Draper wrote:
>
>> Moving the unification of `c` to the top of the run form worked, thanks.
>> Any thoughts on these questions, from the bottom of the gist:
>>
&g
problem to answer a question like,
"what list of N ingredients makes the most different cocktails?"
Thanks again.
On Monday, March 26, 2012 3:07:19 PM UTC-4, David Nolen wrote:
>
> On Mon, Mar 26, 2012 at 2:49 PM, Reid Draper wrote:
>
>>
>>
>> On Sunday, March 25
earlier? The order of forms in a `run` clause don't matter, right?
>
> David
>
> On Sun, Mar 25, 2012 at 4:59 PM, Reid Draper wrote:
>
>> I've been playing around with core.logic and
>> have written a few things that don't seem to
>> terminate. M
I've been playing around with core.logic and
have written a few things that don't seem to
terminate. My intuition says they should work,
but I imagine I'm either making a simple
mistake, or abusing something.
I've written the question as a gist,
for better formatting
https://gist.github.com/21994
24 matches
Mail list logo