branch: master commit 1d7761cfe379df92226216ad0fa49aa7fb619cb3 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
Add constant comment test. --- test/context-coloring-test.el | 23 +++++++++++++++++++++-- test/fixtures/depth.el | 2 ++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el index 5007c3c..7466e23 100644 --- a/test/context-coloring-test.el +++ b/test/context-coloring-test.el @@ -212,9 +212,9 @@ environment." "Assert that the face at POSITION satisfies FACE-REGEXP." (let ((face (get-text-property position 'face))) (when (or - ;; Pass a non-string to do an `eq' check (against a symbol or nil). + ;; Pass a non-string to do an `equal' check (against a symbol or nil). (unless (stringp face-regexp) - (not (eq face-regexp face))) + (not (equal face-regexp face))) ;; Otherwise do the matching. (when (stringp face-regexp) (not (string-match-p face-regexp (symbol-name face))))) @@ -229,6 +229,10 @@ environment." (context-coloring-test-assert-position-face position "\\`font-lock-comment\\(-delimiter\\)?-face\\'")) +(defun context-coloring-test-assert-position-constant-comment (position) + (context-coloring-test-assert-position-face position '(font-lock-constant-face + font-lock-comment-face))) + (defun context-coloring-test-assert-position-string (position) (context-coloring-test-assert-position-face position 'font-lock-string-face)) @@ -260,6 +264,10 @@ environment." ((= char 59) (context-coloring-test-assert-position-comment (point)) (forward-char)) + ;; 'c' = Constant comment + ((= char 99) + (context-coloring-test-assert-position-constant-comment (point)) + (forward-char)) ;; 's' = String ((= char 115) (context-coloring-test-assert-position-string (point)) @@ -1163,6 +1171,17 @@ see that function." 2222 1 1 2 2 2 000022 1111 1 1 1 0 0 000011"))) +(context-coloring-test-deftest-emacs-lisp-mode depth + (lambda () + (let ((context-coloring-emacs-lisp-iterations-per-pause 1)) + (context-coloring-colorize) + (context-coloring-test-assert-coloring " +;; `cc' `cc' +(xxxxx x ())"))) + :setup (lambda () + (setq context-coloring-syntactic-comments t) + (setq context-coloring-syntactic-strings t))) + (provide 'context-coloring-test) ;;; context-coloring-test.el ends here diff --git a/test/fixtures/depth.el b/test/fixtures/depth.el new file mode 100644 index 0000000..c4e99ac --- /dev/null +++ b/test/fixtures/depth.el @@ -0,0 +1,2 @@ +;; `aa' `bb' +(defun a ())