KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this (not (some #(= (:length %1) 0) %)) as a postcondition. Written like this it's pretty clear, but when this condition isn't met I get this: Assert failed: (not (some (fn* [p1__17852#] (= (:length p1__17852#) 0)) %)) Which isn't very readable. Is there a way to define the message for a postcondition, or for a precondition? Edit 1: Following noahlz and noisesmiths suggestion, (but using an external named function): (defn not-zero-length [evseq] (not (some (fn [item] (= (:length item) 0)) evseq))) (defn my-func [evseq] {:post [(not-zero-length %)]} evseq) (my-func '({:length 3}{:length 0})) gives: AssertionError Assert failed: (not-zero-length %) Which is alot clearer.
Tags (comma-separated)
Save Edits
Cancel