Skip to content

Commit e0953b0

Browse files
author
Vadim Rodionov
committed
Add tests for clojure-sexp-starts-until-position
1 parent b51089d commit e0953b0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/clojure-mode-sexp-test.el

+18
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,24 @@
169169
(goto-char (point-max))
170170
(expect (clojure-find-ns) :to-equal expected)))))))
171171

172+
(describe "clojure-sexp-starts-until-position"
173+
(it "should return starting points for forms after POINT until POSITION"
174+
(with-clojure-buffer "(run 1) (def b 2) (slurp \"file\")\n"
175+
(goto-char (point-min))
176+
(expect (not (cl-set-difference '(19 9 1)
177+
(clojure-sexp-starts-until-position (point-max)))))))
178+
179+
(it "should return starting point for a single form in buffer after POINT"
180+
(with-clojure-buffer "comment\n"
181+
(goto-char (point-min))
182+
(expect (not (cl-set-difference '(1)
183+
(clojure-sexp-starts-until-position (point-max)))))))
184+
185+
(it "should return nil if POSITION is behind POINT"
186+
(with-clojure-buffer "(run 1) (def b 2)\n"
187+
(goto-char (point-max))
188+
(expect (not (clojure-sexp-starts-until-position (- (point-max) 1)))))))
189+
172190
(provide 'clojure-mode-sexp-test)
173191

174192
;;; clojure-mode-sexp-test.el ends here

0 commit comments

Comments
 (0)