Hi Michel, I find that when I want to use randomness in tests, I just create a random value and use it. I've never felt a compelling need for special test-related syntax for random values. The "property" syntax is shorter, but I tend to think it's only useful in testing very mathematical code where you can assert non-trivial properties that always hold.
That's not to say there isn't a place for this in contrib. I'd be happy to have this available as an extension to test-is, but I'd prefer to have it in its own namespace so that test-is doesn't grow too much. -Stuart Sierra On Feb 23, 5:47 pm, Michel Salim <michel.syl...@gmail.com> wrote: > I recently wrote a test framework for Scheme, initially similar to > what test-is provides; recently, it has been extended to add random > checks akin to Haskell's QuickCheck. > > The syntax is very similar (I have not bothered defining a 'deftest' > form, but that is trivial): > (define a-test (test a-test (+ 2 2) 4)) <==> (deftest a-test (is (+ 2 2) 4)) > > The property syntax, inspired by the Fact library announced here, is as > follows: > > (define a-property (property add-commutes ([x randint] [y randint]) (= > (+ x y) (+ y x)))) > > which expands to a normal test, the body of which is a doseq such that > x and y both iterate over a sequence of random integers > > The announcement on comp-lang-scheme is > here:http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/... > > I just filled out the contributor's agreement (I just need to mail > it), so if people are interested I can port the property part to > Clojure and file a request at clojure-contrib. > > Regards, > > -- > miʃel salim • http://hircus.jaiku.com/ > IUCS • msa...@cs.indiana.edu > Fedora • sali...@fedoraproject.org > MacPorts • hir...@macports.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---