diff options
Diffstat (limited to 'test/lisp/progmodes')
-rw-r--r-- | test/lisp/progmodes/asm-mode-tests.el | 10 | ||||
-rw-r--r-- | test/lisp/progmodes/elisp-mode-tests.el | 56 |
2 files changed, 66 insertions, 0 deletions
diff --git a/test/lisp/progmodes/asm-mode-tests.el b/test/lisp/progmodes/asm-mode-tests.el index 6ae4fdf5850..87872179d93 100644 --- a/test/lisp/progmodes/asm-mode-tests.el +++ b/test/lisp/progmodes/asm-mode-tests.el @@ -69,4 +69,14 @@ (should (string-match-p ";;; \nlabel:" (buffer-string))) (should (= (current-column) 4)))) +(ert-deftest asm-mode-tests-fill-comment () + (asm-mode-tests--with-temp-buffer + (call-interactively #'comment-dwim) + (insert "Pellentesque condimentum, magna ut suscipit hendrerit, \ +ipsum augue ornare nulla, non luctus diam neque sit amet urna.") + (call-interactively #'fill-paragraph) + (should (equal (buffer-string) "\t;; Pellentesque condimentum, \ +magna ut suscipit hendrerit,\n\t;; ipsum augue ornare nulla, non \ +luctus diam neque sit amet\n\t;; urna.")))) + ;;; asm-mode-tests.el ends here diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index fd43707f277..badcad670c2 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -834,5 +834,61 @@ to (xref-elisp-test-descr-to-target xref)." (indent-region (point-min) (point-max)) (should (equal (buffer-string) orig))))) +(defun test--font (form search) + (with-temp-buffer + (emacs-lisp-mode) + (if (stringp form) + (insert form) + (pp form (current-buffer))) + (font-lock-debug-fontify) + (goto-char (point-min)) + (and (re-search-forward search nil t) + (get-text-property (match-beginning 1) 'face)))) + +(ert-deftest test-elisp-font-keywords-1 () + ;; Special form. + (should (eq (test--font '(if foo bar) "(\\(if\\)") + 'font-lock-keyword-face)) + ;; Macro. + (should (eq (test--font '(when foo bar) "(\\(when\\)") + 'font-lock-keyword-face)) + (should (eq (test--font '(condition-case nil + (foo) + (error (if a b))) + "(\\(if\\)") + 'font-lock-keyword-face)) + (should (eq (test--font '(condition-case nil + (foo) + (when (if a b))) + "(\\(when\\)") + 'nil))) + +(ert-deftest test-elisp-font-keywords-2 () + (should (eq (test--font '(condition-case nil + (foo) + (error (when a b))) + "(\\(when\\)") + 'font-lock-keyword-face))) + +(ert-deftest test-elisp-font-keywords-3 () + (should (eq (test--font '(setq a '(if when zot)) + "(\\(if\\)") + nil))) + +(ert-deftest test-elisp-font-keywords-4 () + :expected-result :failed ; FIXME bug#43265 + (should (eq (test--font '(condition-case nil + (foo) + ((if foo) (when a b))) + "(\\(if\\)") + nil))) + +(ert-deftest test-elisp-font-keywords-5 () + (should (eq (test--font '(condition-case (when a) + (foo) + (error t)) + "(\\(when\\)") + nil))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here |