(Moderators ... resending this, sorry if it's already in the queue)
Hi,
I'd like to be able to use the *are* testing macro like this:
(are [input]
(= input (myfun input))
*my-input-data*)
But this doesn't work; the args are expected to be listed on-by-one,
not in a list:
(defmacro are
[argv expr & args]
`(temp/do-template ~argv (is ~expr) ~...@args))
My fix is to write my own are macro:
(defmacro are-list
"Like the buit-in are, but args is passed in as a single list"
[argv expr lst]
(let [the-list (eval lst)]
`(are ~argv ~expr ~...@the-list#)))
Is this a good solution? Is there a better approach? The call to eval
seems unfortunate to me.
Thanks,
Dan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en