Navigation Menu

Skip to content

Commit

Permalink
Updated Fact dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester authored and technomancy committed Jul 16, 2009
1 parent d33f0ba commit fe9382e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions deps/fact.clj
Expand Up @@ -226,18 +226,22 @@
(.println *test-out* (format-result result)))
(print-summary results))

(def ansi-red "\033[31m")
(def ansi-green "\033[32m")
(def ansi-brown "\033[33m")
(def ansi-default "\033[0m")

(defn print-color-results
"Print the results from a set of verified facts... in COLOR!
(Requires a shell with ANSI-compatible colors)"
[results]
(doseq [result results]
(cond
(pending? result) (.print *test-out* "\033[33m")
(exception? result) (.print *test-out* "\033[31m")
(failure? result) (.print *test-out* "\033[31m")
:fact-passed (.print *test-out* "\033[32m"))
(pending? result) (.print *test-out* ansi-brown)
(exception? result) (.print *test-out* ansi-red)
(failure? result) (.print *test-out* ansi-red)
:fact-passed (.print *test-out* ansi-green))
(.print *test-out* (format-result result))
(.print *test-out* "\033[0m")
(.println *test-out*))
(print-summary results))

0 comments on commit fe9382e

Please sign in to comment.