Permalink
Browse files

Refactoring boot.

  • Loading branch information...
1 parent a269d1e commit 2f315e4d3cc8f36a1d2b4298c2d6c5d601977b9a Arlen Christian Mart Cuss committed Dec 3, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/boot.rg
View
12 lib/boot.rg
@@ -375,6 +375,13 @@
{:passed @*tests-passed*
:failed @*tests-failed*})))
+(defn format-actual [check]
+ (if (and (seq? check)
+ (= (first check) 'not)
+ (= (count check) 2))
+ (second check)
+ `(not ~check)))
+
(defmacro is [check]
`(let [result# (try
{:error nil, :result ~check}
@@ -389,10 +396,7 @@
(let [error# (get result# :error)]
(if error#
error#
- (if (and (seq? '~check)
- (= 'not (first '~check)))
- (second '~check)
- `(not ~'~check))))]
+ (format-actual '~check)))]
(puts " actual: " (pr-str actual#))))
(do
(swap! *tests-passed* inc)

0 comments on commit 2f315e4

Please sign in to comment.