Skip to content

Commit 8934663

Browse files
committed
Add a couple of unit tests for cider-list-at-point
1 parent aa144ce commit 8934663

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/cider-util-tests.el

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,23 @@ buffer."
159159
(spy-on 'thing-at-point :and-return-value "boogie>")
160160
(expect (cider-symbol-at-point) :to-equal "boogie>")))
161161

162+
(describe "cider-list-at-point"
163+
(describe "when the param 'bounds is not given"
164+
(it "returns the list at point"
165+
(with-clojure-buffer "(1 2 3|)"
166+
(expect (cider-list-at-point) :to-equal "(1 2 3)")))
167+
168+
(it "handle leading @ reader macro properly"
169+
(with-clojure-buffer "@(1 2 3|)"
170+
(expect (cider-list-at-point) :to-equal "@(1 2 3)"))))
171+
172+
(describe "when the param 'bounds is given"
173+
(it "returns the bounds of starting and ending positions of the sexp"
174+
(with-clojure-buffer "(1 2 3|)"
175+
(delete-char -1)
176+
(insert "'")
177+
(expect (cider-list-at-point 'bounds) :to-equal '(1 8))))))
178+
162179
(describe "cider-sexp-at-point"
163180
(describe "when the param 'bounds is not given"
164181
(it "returns the sexp at point"

0 commit comments

Comments
 (0)