Skip to content

Commit

Permalink
remove-n
Browse files Browse the repository at this point in the history
  • Loading branch information
marick committed Sep 12, 2010
1 parent 823395c commit c6e88b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/midje/fact_body_transformation.clj
Expand Up @@ -45,6 +45,11 @@

;; Editing

(defn remove-n [n loc]
(if (= n 0)
loc
(recur (- n 1) (zip/remove loc))))

(defn remove-n [loc n]
(if (= n 0)
loc
Expand All @@ -71,7 +76,7 @@
additions (overrides right-hand)
edited-loc (zip/edit loc
(fn [loc] `(expect ~loc => ~(zip/node right-hand))))]
(-> edited-loc zip/right zip/right zip/remove zip/remove)))
(-> edited-loc zip/right zip/right (remove-n 2))))

;; The meat of it.

Expand Down

0 comments on commit c6e88b4

Please sign in to comment.