Re: test.check generating hierarchy with relations

2014-12-18 Thread Reid Draper
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:

Re: test.check generating hierarchy with relations

2014-12-09 Thread cliff
Nico, what is the correct way to turn my function which generates the graph (using core.logic) into a generator? On Monday, 8 December 2014 09:04:14 UTC+2, cliff wrote: > > Hi > > I would like to test a function which recursively traverses the nodes in a > graph and collects them. For example,

Re: test.check generating hierarchy with relations

2014-12-09 Thread cliff
Hi Nico Thanks for your advice. * The `size` param in `gen-hierarchy` is being passed as the first param to > `run`, which limits the count of results returned by core.logic. What's the > intention there? I think it's most common to grab one result from run, or > all of them (to check if it al

Re: test.check generating hierarchy with relations

2014-12-09 Thread Nicolás Berger
Hey Cliff, A couple comments: * The `size` param in `gen-hierarchy` is being passed as the first param to `run`, which limits the count of results returned by core.logic. What's the intention there? I think it's most common to grab one result from run, or all of them (to check if it always genera

Re: test.check generating hierarchy with relations

2014-12-08 Thread cliff
Hi Gary I have tried your suggestion but I fear there is a deeper problem. Thanks Cliff On Monday, 8 December 2014 12:03:47 UTC+2, Gary Verhaegen wrote: > > I haven't touched test.check yet, si this might be completely off the > mark, but based on my limited understanding, here's what I think h

Re: test.check generating hierarchy with relations

2014-12-08 Thread Gary Verhaegen
I haven't touched test.check yet, si this might be completely off the mark, but based on my limited understanding, here's what I think happens. for-all probably removes one level of nesting from your generator, which means that bindings is bound to a seq with one element, which is a map. Then, key

test.check generating hierarchy with relations

2014-12-07 Thread cig
Hi I would like to test a function which recursively traverses the nodes in a graph and collects them. For example, (def graph {1 [2 3 4] 2 [5 6 7] 6 [8 9] 10 [11 12 13]} my function is given a starting point say, 1 and should then traver