File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 33 [rewrite-clj.zip
44 [base :as base]
55 [move :as m]
6- [insert :refer :all ]]))
6+ [insert :refer :all ]]
7+ [fast-zip.core :as z]))
78
89(tabular
910 (fact " about whitespace-aware insertion."
2930 " [%s]" 0 append-child " [1 2 3 4 x]"
3031 " [ %s]" 0 insert-child " [x 1 2 3 4]"
3132 " [%s ]" 0 append-child " [1 2 3 4 x]" )
33+
34+ (future-fact
35+ " about inserting after comment."
36+ (let [loc (-> (base/of-string " [1 2 3] ; this is a comment" )
37+ (z/rightmost )
38+ (insert-right 'x))]
39+ (base/root-string loc) => " [1 2 3] ; this is a comment\n x" ))
Original file line number Diff line number Diff line change 33 [rewrite-clj.zip
44 [base :as base]
55 [move :as m]
6- [remove :as r]]))
6+ [remove :as r]]
7+ [fast-zip.core :as z]))
78
89(tabular
910 (fact " about whitespace-aware removal."
3435 (-> root m/next m/down r/remove base/root-string)
3536 => (str " :k [[d e f]]\n "
3637 " :keyword 0" )))
38+
39+ (future-fact
40+ " about removing after comment."
41+ (let [loc (-> (base/of-string " ; comment\n x" )
42+ (z/rightmost )
43+ (r/remove ))]
44+ (base/root-string loc) => " ; comment" ))
You can’t perform that action at this time.
0 commit comments