Skip to content

Commit

Permalink
Port variable-def-string-with-docstring font lock test from clojure-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kommen committed Oct 26, 2024
1 parent aa7d285 commit dcf87d2
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions test/clojure-ts-mode-font-lock-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,37 @@ DESCRIPTION is the description of the spec."
("(defrecord a [b c])" (2 10 font-lock-keyword-face))
("(deftype a [b c])" (2 8 font-lock-keyword-face))
("(defstruct a :b :c)" (2 10 font-lock-keyword-face))
("(deftest a (is (= 1 1)))" (2 8 font-lock-keyword-face))


;; TODO: copied from clojure-mode, but failing
;; ("(defne [x y])" (2 6 font-lock-keyword-face))
;; ("(defnm a b)" (2 6 font-lock-keyword-face))
;; ("(defnu)" (2 6 font-lock-keyword-face))
;; ("(defnc [a])" (2 6 font-lock-keyword-face))
;; ("(defna)" (2 6 font-lock-keyword-face))
;; ("(deftask a)" (2 8 font-lock-keyword-face))
;; ("(defstate a :start \"b\" :stop \"c\")" (2 9 font-lock-keyword-face)))
)
("(deftest a (is (= 1 1)))" (2 8 font-lock-keyword-face)))

(when-fontifying-it "variable-def-string-with-docstring"
("(def foo \"usage\" \"hello\")"
(10 16 font-lock-doc-face)
(18 24 font-lock-string-face))

("(def foo \"usage\" \"hello\" )"
(18 24 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))

("(def foo \n \"usage\" \n \"hello\")"
(13 19 font-lock-doc-face)
(24 30 font-lock-string-face))

("(def test-string\n \"this\\n\n is\n my\n string\")"
(20 24 font-lock-string-face)
(25 26 font-lock-string-face)
(27 46 font-lock-string-face)))

;; TODO: copied from clojure-mode, but failing
;; ("(defne [x y])" (2 6 font-lock-keyword-face))
;; ("(defnm a b)" (2 6 font-lock-keyword-face))
;; ("(defnu)" (2 6 font-lock-keyword-face))
;; ("(defnc [a])" (2 6 font-lock-keyword-face))
;; ("(defna)" (2 6 font-lock-keyword-face))
;; ("(deftask a)" (2 8 font-lock-keyword-face))
;; ("(defstate a :start \"b\" :stop \"c\")" (2 9 font-lock-keyword-face))
)

0 comments on commit dcf87d2

Please sign in to comment.