Skip to content

Commit

Permalink
Declare indentation spec for test util functions
Browse files Browse the repository at this point in the history
And auto-indent some lines
  • Loading branch information
yuhan0 committed Mar 26, 2020
1 parent 9400ccf commit 642b1e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/clojure-mode-font-lock-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ TESTS are lists of the form (content (start end expected-face)*). For each test
check that each `expected-face` is found in `content` between `start` and `end`.
DESCRIPTION is the description of the spec."
(declare (indent 1))
`(it ,description
(dolist (test (quote ,tests))
(apply #'expect-faces-at test))))
Expand Down Expand Up @@ -797,8 +798,8 @@ DESCRIPTION is the description of the spec."
("(def foo \"usage\" \"hello\" )"
(18 24 font-lock-string-face))

("(def foo \"usage\" \n \"hello\")"
(21 27 font-lock-string-face))
("(def foo \"usage\" \n \"hello\")"
(21 27 font-lock-string-face))

("(def foo \n \"usage\" \"hello\")"
(13 19 font-lock-doc-face))
Expand Down Expand Up @@ -864,8 +865,8 @@ DESCRIPTION is the description of the spec."

(when-fontifying-it "should handle keyword-meta"
("^:meta-data"
(1 1 nil)
(2 11 clojure-keyword-face)))
(1 1 nil)
(2 11 clojure-keyword-face)))

(when-fontifying-it "should handle a keyword with allowed characters"
(":aaa#bbb"
Expand Down
2 changes: 2 additions & 0 deletions test/utils/test-helper.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

(defmacro with-clojure-buffer (text &rest body)
"Create a temporary buffer, insert TEXT, switch to clojure-mode and evaluate BODY."
(declare (indent 1))
`(with-temp-buffer
(erase-buffer)
(insert ,text)
Expand All @@ -49,6 +50,7 @@ AFTER.
BODY should contain the refactoring that transforms BEFORE into AFTER.
DESCRIPTION is the description of the spec."
(declare (indent 1))
`(it ,description
(with-clojure-buffer ,before
,@body
Expand Down

0 comments on commit 642b1e8

Please sign in to comment.