Skip to content

Commit e8aec2a

Browse files
committed
Add tests for correct treatment of prefix syntax
1 parent 5609660 commit e8aec2a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/clojure-mode-indentation-test.el

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,25 @@ x
637637
(should-not (non-func "^hint " form))
638638
(should-not (non-func "#macro " form))))
639639

640+
(ert-deftest clojure-syntax-prefixed-symbols ()
641+
(dolist (form '(("#?@aaa" . "aaa")
642+
("#?aaa" . "?aaa")
643+
("#aaa" . "aaa")
644+
("'aaa" . "aaa")))
645+
(with-temp-buffer
646+
(clojure-mode)
647+
(insert (car form))
648+
(equal (symbol-name (symbol-at-point)) (cdr form)))))
649+
650+
(ert-deftest clojure-syntax-skip-prefixes ()
651+
(dolist (form '("#?@aaa" "#?aaa" "#aaa" "'aaa"))
652+
(with-temp-buffer
653+
(clojure-mode)
654+
(insert form)
655+
(backward-word)
656+
(backward-prefix-chars)
657+
(should (bobp)))))
658+
640659
(provide 'clojure-mode-indentation-test)
641660

642661
;;; clojure-mode-indentation-test.el ends here

0 commit comments

Comments
 (0)