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 3
3
[rewrite-clj.zip
4
4
[base :as base]
5
5
[move :as m]
6
- [insert :refer :all ]]))
6
+ [insert :refer :all ]]
7
+ [fast-zip.core :as z]))
7
8
8
9
(tabular
9
10
(fact " about whitespace-aware insertion."
29
30
" [%s]" 0 append-child " [1 2 3 4 x]"
30
31
" [ %s]" 0 insert-child " [x 1 2 3 4]"
31
32
" [%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 3
3
[rewrite-clj.zip
4
4
[base :as base]
5
5
[move :as m]
6
- [remove :as r]]))
6
+ [remove :as r]]
7
+ [fast-zip.core :as z]))
7
8
8
9
(tabular
9
10
(fact " about whitespace-aware removal."
34
35
(-> root m/next m/down r/remove base/root-string)
35
36
=> (str " :k [[d e f]]\n "
36
37
" :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