diff options
Diffstat (limited to 'test/lisp/emacs-lisp/lisp-mode-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/lisp-mode-tests.el | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index fd1af75ba3f..996ea201fb0 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -330,5 +330,30 @@ Expected initialization file: `%s'\" (faceup-clean-buffer) (should (faceup-test-font-lock-buffer 'emacs-lisp-mode faceup))))) +(ert-deftest test-lisp-current-defun-name () + (require 'edebug) + (with-temp-buffer + (emacs-lisp-mode) + (insert "(defun foo ()\n'bar)\n") + (goto-char 5) + (should (equal (lisp-current-defun-name) "foo"))) + (with-temp-buffer + (emacs-lisp-mode) + (insert "(define-flabbergast-test zot ()\n'bar)\n") + (goto-char 5) + (should (equal (lisp-current-defun-name) "zot"))) + ;; These tests should probably work after bug#49592 has been fixed. + ;; (with-temp-buffer + ;; (emacs-lisp-mode) + ;; (insert "(progn\n ;; comment\n ;; about that\n (define-key ...)\n )") + ;; (goto-char 5) + ;; (should (equal (lisp-current-defun-name) "progn"))) + ;; (with-temp-buffer + ;; (emacs-lisp-mode) + ;; (insert "(defblarg \"a\" 'b)") + ;; (goto-char 5) + ;; (should (equal (lisp-current-defun-name) "defblarg"))) + ) + (provide 'lisp-mode-tests) ;;; lisp-mode-tests.el ends here |