Skip to content

Commit

Permalink
Test for preserving buffer-specific font-lock keywords
Browse files Browse the repository at this point in the history
See GH-222.
  • Loading branch information
jrblevin committed Nov 11, 2017
1 parent 2dde7b3 commit d3de4b4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -5060,6 +5060,23 @@ This includes preserving whitespace after the pipe."
;; User keyword should not be present after removal.
(should-not (member user-keyword (cadr font-lock-keywords))))))

(ert-deftest test-markdown-math/preserve-local-user-keywords ()
"Test preserving buffer-specific user-specified font-lock keywords."
(let ((user-keyword '("\\<\\(FIXME\\):" 1 font-lock-warning-face t)))
;; Visit a file using `markdown-mode'.
(markdown-test-file "math.text"
;; Add user font-lock keyword using `font-lock-add-keywords'.
(font-lock-add-keywords nil (list user-keyword))
;; User keyword should be present initially.
(should (member user-keyword (cadr font-lock-keywords)))
;; User keyword should persist after calling `markdown-reload-extensions'.
(markdown-reload-extensions)
(should (member user-keyword (cadr font-lock-keywords)))
;; Remove the user keyword using `font-lock-remove-keywords'.
(font-lock-remove-keywords nil (list user-keyword))
;; User keyword should not be present after removal.
(should-not (member user-keyword (cadr font-lock-keywords))))))

(ert-deftest test-markdown-math/font-lock ()
"Test markdown math mode."
(let ((markdown-enable-math t))
Expand Down

0 comments on commit d3de4b4

Please sign in to comment.