racket-quickcheck
racket-quickcheck copied to clipboard
Quickcheck Clone implemented in Racket
From the documentation, it would seem that this shouldn't work: ``` (quickcheck (property [(x arbitrary-integer)] (property [(y arbitrary-integer)] (= (* x y) (* y x))) ``` But it does; if...
For debugging, it's nice to be able to sample directly from a generator. You can obviously hack this together with state or IO and a property that stores or prints...
I might be misunderstanding what `choose-with-frequencies` does. I was trying to make a generator that produces integers or symbols at random. I did this: ``` #lang racket (require quickcheck) (define...
The doc mentions `check` and `check-results` which are no longer provided https://docs.racket-lang.org/quickcheck/index.html#%28def._%28%28lib._quickcheck%2Fmain..rkt%29._check%29%29
Hi , Please add the racket topic to this repo - I think others will be interested and this will help them find it at https://github.com/topics/racket https://help.github.com/en/articles/classifying-your-repository-with-topics Kind regards, Stephen
The documentation for the `arbitrary` struct says: ``` Represents a source of randomly generated values, except where the values are filtered by the function trans to produce a narrower set...
I have a simple macro that allows one to define the following: ``` (define arbitrary-int-char-list-same-length (property* ([n arbitrary-natural] [int-list (choose-list (arbitrary-generator arbitrary-integer) n)] [char-list (choose-list (arbitrary-generator arbitrary-char) n)]) (display n)(newline)...
For instance, `(quickcheck (property ([int-list (choose-list arbitrary-integer 10)]) (= 1 1)))` fails because `arbitrary-integer` is not a generator, but it is trivially converted to one using `coerce->generator`. The exact error...
When Haskell's QuickCheck finds a failing input to a property, before displaying the failure it will attempt to _shrink_ the input first. For instance a list of numbers that fails...
In the Haskell library, properties are merely functions (usually). Their types indicate how they're wired up to arbitraries, and that wiring happens "magically" through typeclasses. Racket however has neither typeclasses...