Skip to content

Commit 84317c8

Browse files
author
Yannick Scherer
committed
Added tests for splice.
1 parent c3a7d21 commit 84317c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/rewrite_clj/zip_test.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
(-> root z/down z/right z/right (z/edit + 5) z/root)
8282
=> [:vector [:token 1] [:whitespace "\n "] [:token 2] [:whitespace "\n "] [:token 8]]))
8383

84+
(fact "about zipper splice"
85+
(let [root (z/edn (p/parse-string "[1 [2 3] 4]"))]
86+
(z/sexpr root) => [1 [2 3] 4]
87+
(-> root z/down z/right z/splice z/up z/sexpr) => [1 2 3 4]))
88+
8489
(fact "about zipper search/find traversal"
8590
(-> root z/down (z/find-value :description) z/right z/node) => [:token "A project."]
8691
(-> root (z/find-value z/next :description) z/right z/node) => [:token "A project."]

0 commit comments

Comments
 (0)