I'd say there's nothing wrong with your second assertion but you were
just lucky enough to try it with a function defined as :inline, which
is caught by the compiler as being called with the wrong arity.

The quot definition:
https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L1226-L1232

If you are just playing around with detecting exceptions, just avoid
:inline functions :)

If you want some info about inline functions:
http://www.bytopia.org/2014/07/07/inline-functions-in-clojure/

HTH


On Mon, Sep 21, 2015 at 12:13 PM, Lance Campbell <lkcampb...@gmail.com> wrote:
> Familiarizing myself with detecting exceptions with clojure.test. Purely for
> my own education.
>
> This assertion works:
>
> (is (thrown? clojure.lang.ArityException (/)))
>
> This assertions does not:
>
> (is (thrown? clojure.lang.ArityException (quot)))
>
> Caused by: clojure.lang.ArityException: Wrong number of args (0) passed to:
> core/quot--inliner--4345
>
> Is there something wrong with the way I wrote my second assertion?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to