branch: elpa/clojure-ts-mode
commit 1735a1a4dc6ca590035dc01ab4d95c0b5800c127
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Add tests for builtin macro font-locking
Cover io!, sync, in-ns, and other builtin macros to prevent
regressions like the string concatenation bug fixed earlier.
---
test/clojure-ts-mode-font-lock-test.el | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/test/clojure-ts-mode-font-lock-test.el
b/test/clojure-ts-mode-font-lock-test.el
index 4770ccf37e..ab639ffa9d 100644
--- a/test/clojure-ts-mode-font-lock-test.el
+++ b/test/clojure-ts-mode-font-lock-test.el
@@ -231,6 +231,19 @@ DESCRIPTION is the description of the spec."
(.setObject s i (->pgobject m))))"
(81 93 font-lock-function-name-face))))
+;;;; Builtin macros
+
+(describe "builtin-macro-highlighting"
+ (when-fontifying-it "should highlight all builtin macros as keywords"
+ ("(io! (println \"hi\"))" (2 4 font-lock-keyword-face))
+ ("(sync nil (println \"hi\"))" (2 5 font-lock-keyword-face))
+ ("(in-ns 'foo)" (2 6 font-lock-keyword-face))
+ ("(let [a 1] a)" (2 4 font-lock-keyword-face))
+ ("(when true 1)" (2 5 font-lock-keyword-face))
+ ("(fn [x] x)" (2 3 font-lock-keyword-face))
+ ("(some->> x inc)" (2 8 font-lock-keyword-face))
+ ("(some-> x inc)" (2 7 font-lock-keyword-face))))
+
;;;; Extra def forms
(describe "clojure-ts-extra-def-forms"