* clojure.contrib.test-is becomes clojure.test
* clojure.contrib.stacktrace becomes clojure.stacktrace
* clojure.contrib.template becomes clojure.template
* clojure.contrib.walk becomes clojure.walk
Thanks to Stuart Sierra for writing all these libraries. If you are
using one of them (and working with head), you will need to rename it
in your use/require/ns forms. Also, the signature and implementation
of test/are has changed, and is now more idiomatic. For example:
(deftest test-count
(are [x y] (= x y) ; instead of (are (= _1 _2))
(count nil) 0
(count ()) 0
(count '(1)) 1
(count '(1 2 3)) 3
; etc.
The purpose of this change (other than the general usefulness of the
libraries!) is to let Clojure host its own test suite. You can now run
Clojure's tests with "ant test".
Go ye now, sign the CA, and write some great tests for Clojure. You
know you want to.
Stu
On Thu, Jun 25, 2009 at 10:40 PM, Stuart
Halloway<stuart....@gmail.com> wrote:
> ... Also, the signature and implementation
> of test/are has changed, and is now more idiomatic. For example:
>
> (deftest test-count
> (are [x y] (= x y) ; instead of (are (= _1 _2))
> (count nil) 0
> (count ()) 0
> (count '(1)) 1
> (count '(1 2 3)) 3
> ; etc.
The discussion took place here:
http://groups.google.com/group/clojure-dev/msg/2df101865a378156?hl=en
> This change makes it relatively expensive for
> any library with a significant test suite that uses 'are' to keep
> testing with both the current release and the current snapshot of
> clojure and contrib.
If you really want to maintain a single test suite for both
1.0.x and 'master', it shouldn't be difficult to write
a macro that expands to either the old or new 'are' syntax,
depending on the Clojure version runnin.
--Chouser