]> code.delx.au - gnu-emacs/blob - test/lisp/help-fns-tests.el
babba1a68fc23d1e7c41bb1ddbc7a1bb6b489574
[gnu-emacs] / test / lisp / help-fns-tests.el
1 ;;; help-fns.el --- tests for help-fns.el
2
3 ;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
4
5 ;; Maintainer: emacs-devel@gnu.org
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22 ;;; Commentary:
23
24 ;;; Code:
25
26 (require 'ert)
27
28 (autoload 'help-fns-test--macro "help-fns" nil nil t)
29
30 (ert-deftest help-fns-test-bug17410 ()
31 "Test for http://debbugs.gnu.org/17410 ."
32 (describe-function 'help-fns-test--macro)
33 (with-current-buffer "*Help*"
34 (goto-char (point-min))
35 (should (search-forward "autoloaded Lisp macro" (line-end-position)))))
36
37 (defun abc\\\[universal-argument\]b\`c\'d\\e\"f (x)
38 "A function with a funny name.
39
40 \(fn XYZZY)"
41 x)
42
43 (defun defgh\\\[universal-argument\]b\`c\'d\\e\"f (x)
44 "Another function with a funny name."
45 x)
46
47 (ert-deftest help-fns-test-funny-names ()
48 "Test for help with functions with funny names."
49 (describe-function 'abc\\\[universal-argument\]b\`c\'d\\e\"f)
50 (with-current-buffer "*Help*"
51 (goto-char (point-min))
52 (should (search-forward
53 "(abc\\\\\\[universal-argument\\]b\\`c\\'d\\\\e\\\"f XYZZY)")))
54 (describe-function 'defgh\\\[universal-argument\]b\`c\'d\\e\"f)
55 (with-current-buffer "*Help*"
56 (goto-char (point-min))
57 (should (search-forward
58 "(defgh\\\\\\[universal-argument\\]b\\`c\\'d\\\\e\\\"f X)"))))
59
60 (ert-deftest help-fns-test-describe-symbol ()
61 "Test the `describe-symbol' function."
62 ;; 'describe-symbol' would originally signal an error for
63 ;; 'font-lock-comment-face'.
64 (describe-symbol 'font-lock-comment-face)
65 (with-current-buffer "*Help*"
66 (should (> (point-max) 1))
67 (goto-char (point-min))
68 (should (looking-at "^font-lock-comment-face is "))))
69
70 ;;; help-fns.el ends here