| | |
| | | ~@body)) |
| | | |
| | | (with-class-cache |
| | | (require '[clojure.test :as t])) |
| | | (require '[clojure.test :as t] |
| | | '[lambdaisland.deep-diff2 :as ddiff])) |
| | | |
| | | (def no-colors-printer (ddiff/printer {:print-color false})) |
| | | (defmulti vim-report :type) |
| | | |
| | | (defmethod vim-report :begin-test-ns [m] |
| | |
| | | (println (str "FAIL-CONTINUE:EXPECTED:" (pr-str (:expected m)))) |
| | | (println (str "FAIL-CONTINUE:ACTUAL:" (pr-str (:actual m)))))) |
| | | |
| | | (defmethod t/assert-expr '= [msg form] |
| | | (let [args (rest form) |
| | | pred (first form)] |
| | | `(let [values# (list ~@args) |
| | | result# (apply ~pred values#)] |
| | | (if result# |
| | | (t/do-report {:type :pass, :message ~msg, |
| | | :expected '~form, :actual (cons '~pred values#)}) |
| | | (do |
| | | (t/do-report {:type :fail, :message ~msg, |
| | | :expected '~form, :actual (list '~'not (cons '~pred values#))}) |
| | | (-> (apply ddiff/diff values#) |
| | | (ddiff/pretty-print no-colors-printer)))) |
| | | result#))) |
| | | |
| | | (defn- find-line-number [source-file m] |
| | | (if (instance? Throwable (:actual m)) |
| | | (let [fname (-> source-file (java.io.File.) (.getName))] |