diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-01-16 15:55:26 +0000 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2009-01-16 15:55:26 +0000 |
commit | 81ef1fb39ded8457b6817a28b1dd0684f2f0465f (patch) | |
tree | 93e011197a0bf85b10551d9d40d4767d5b9f4d74 /src/clojure | |
parent | ce3ee7adf337f896b4a94dc853f7279e807de342 (diff) |
test_is.clj: fixed bug that broke tests if first element wasn't a function
Reported by Stuart Halloway. Still want to recover the fancier
error reporting when the first element IS a function, but need a way to
test *at compile time* if something is a function.
Diffstat (limited to 'src/clojure')
-rw-r--r-- | src/clojure/contrib/test_is.clj | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj index ed2b5e7a..316d6ad3 100644 --- a/src/clojure/contrib/test_is.clj +++ b/src/clojure/contrib/test_is.clj @@ -163,7 +163,9 @@ (seq? form) (first form) :else :single))) -(defmethod assert-expr :default [msg form] +;; Not currently used -- how can we determine if predicate is a normal +;; function and not a macro or method call? +(defmethod assert-expr :predicate [msg form] ;; Generic assertion for any functional predicate. The 'expected' ;; argument to 'report' contains the original form, the 'actual' ;; argument contains the form with all its sub-forms evaluated. If @@ -182,8 +184,8 @@ ;; nil test: always fail `(report :fail ~msg nil nil)) -(defmethod assert-expr :single [msg form] - ;; Evaluate a bare symbol and pass if it is logical true. +(defmethod assert-expr :default [msg form] + ;; Evaluate any expression and pass if it is logical true. `(let [value# ~form] (if value# (report :pass ~msg '~form value#) |