gfredericks / test.chuck

A utility library for test.check
Eclipse Public License 1.0
215 stars 26 forks source link

Obscured quick-check results #6

Closed zmaril closed 9 years ago

zmaril commented 9 years ago
(tc/quick-check
 10
 (propc/for-all [a gen/pos-int
                 :when (even? a)
                 :let [b (/ a 3)]
                  xs (gen/vector gen/int b)]
                (= (count xs) b)))

=>
{:result false,
 :seed 1424196426193,
 :failing-size 7,
 :num-tests 8,
 :fail
 [#<core_test$eval20175$fn__20183$fn__20185$fn__20186 parmenides.core_test$eval20175$fn__20183$fn__20185$fn__20186@7c06e10d>],
 :shrunk
 {:total-nodes-visited 8,
  :depth 3,
  :result false,
  :smallest
  (#<core_test$eval20175$fn__20183$fn__20185$fn__20186 parmenides.core_test$eval20175$fn__20183$fn__20185$fn__20186@6c57be14>)}}

Is there a way to get propc/for-all to return the failing values that were generated instead of the nested functions needed to replicate the let functionality?

gfredericks commented 9 years ago

This sounds like issue #5, which is fixed in 0.1.14. If you've already upgraded and are still having this issue let me know and I'll look closer.

zmaril commented 9 years ago

Thanks! The upgrade fixed it, should have checked for that first.