From dcf87d237a1f40dbd1c835e79df43fbdf950a6c0 Mon Sep 17 00:00:00 2001 From: Dieter Komendera Date: Sat, 26 Oct 2024 13:17:06 +0200 Subject: [PATCH] Port variable-def-string-with-docstring font lock test from clojure-mode --- test/clojure-ts-mode-font-lock-test.el | 46 +++++++++++++++++++------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/test/clojure-ts-mode-font-lock-test.el b/test/clojure-ts-mode-font-lock-test.el index eb90995..3c904f0 100644 --- a/test/clojure-ts-mode-font-lock-test.el +++ b/test/clojure-ts-mode-font-lock-test.el @@ -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)) +)