Skip to content

Commit bf9604d

Browse files
author
Yannick Scherer
committed
add tests for whitespace only zippers. (see #20)
1 parent 591ba03 commit bf9604d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/rewrite_clj/zip/base_test.clj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
(base/of-file f)
5656
(base/of-file (.getPath f)))))
5757

58+
(tabular
59+
(fact "about zipper creation for whitespace-only nodes."
60+
(let [n (node/forms-node [?ws])
61+
loc (base/edn n)]
62+
(base/tag loc) => :forms
63+
(base/sexpr loc) => nil
64+
(base/string loc) => ?s
65+
(base/root-string loc) => ?s))
66+
?ws ?s
67+
(node/spaces 3) " "
68+
(node/comment-node "foo") ";foo")
69+
5870
(tabular
5971
(fact "about length calculation."
6072
(let [s ?s

0 commit comments

Comments
 (0)