gfredericks / test.chuck

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

Update clojure-test to use test.chuck for-all #30

Closed dparis closed 8 years ago

dparis commented 8 years ago

Update the checking and for-all macros in the test.chuck.clojure-test namespace to use the test.chuck.properties/for-all function instead of test.check.properties/for-all.

Since the test.chuck.properties/for-all method is intended (AFAIK) to be a drop-in replacement for the vanilla for-all, I don't see any harm in doing this, and then the clojure-test functions can use all of the nice augmented functionality.

The test suite ran cleanly before and after this change, and some local testing of the new SNAPSHOT version allowed my app to correctly define a test using the enhanced for-all behavior in checking.

gfredericks commented 8 years ago

Aw snap; I'm a little disappointed we didn't think of this in the first place, because now it's technically a breaking change.

On the other hand, it's only breaking for users who are using checking AND using multiple clauses in their for-all, which is probably almost nobody. And even if they are using it, their code should still work, it will just be using bind instead of tuple and therefore just not shrink quite as well.

Hey @lackita there's not any other reason this would be a bad idea is there?

lackita commented 8 years ago

I think it's probably fine, wish I had thought of that in the first place.

gfredericks commented 8 years ago

Cool; thanks @dparis for the PR.

gfredericks commented 8 years ago

Released this as 0.2.1.

dparis commented 8 years ago

@gfredericks You're welcome! Glad it worked out, and thank you for cutting a new release so quickly.