Updated the test; solid refactor

This commit is contained in:
Paul deGrandis 2012-03-06 14:38:08 -05:00
parent 831eacb152
commit 33436d478b
2 changed files with 7 additions and 7 deletions

View file

@ -12,9 +12,9 @@
;; rule sets.
(deftest control-structures
(helper/check-form-test '(if true (println "X")) ['(println "X")] 22)
(helper/check-form-test '(if true (println "X")) ['(println "X")])
(helper/check-form-test '(if true (println "X") nil) ['(when true (println "X"))
'(println "X")]23 )
(helper/check-form-test '(if test nil else) ['(when-not test else)] 25)
(helper/check-form-test '(if test then nil) ['(when test then)] 26))
'(println "X")])
(helper/check-form-test '(if test nil else) ['(when-not test else)])
(helper/check-form-test '(if test then nil) ['(when test then)]))

View file

@ -2,8 +2,8 @@
(:require [jonase.kibit.core :as kibit])
(:use [clojure.test :only (is)]))
(defn check-form-test [form expected-alt-list line]
(let [expected (doall (map #(str "[Kibit] Consider " % " instead of " form " at line " line) expected-alt-list))
actual (doall (map :message (kibit/check-form form)))]
(defn check-form-test [form expected-alt-list]
(let [expected expected-alt-list
actual (doall (map :alt (kibit/check-form form)))]
(is (= expected actual))))