diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/shortdoc-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/shortdoc-tests.el b/test/lisp/emacs-lisp/shortdoc-tests.el index 516d095767f..a65a4a5ddc3 100644 --- a/test/lisp/emacs-lisp/shortdoc-tests.el +++ b/test/lisp/emacs-lisp/shortdoc-tests.el | |||
| @@ -65,6 +65,16 @@ | |||
| 65 | (when buf | 65 | (when buf |
| 66 | (kill-buffer buf)))))) | 66 | (kill-buffer buf)))))) |
| 67 | 67 | ||
| 68 | (ert-deftest shortdoc-function-examples-test () | ||
| 69 | "Test the extraction of usage examples of some Elisp functions." | ||
| 70 | (should (equal '((list . "(delete 2 (list 1 2 3 4))\n => (1 3 4)\n (delete \"a\" (list \"a\" \"b\" \"c\" \"d\"))\n => (\"b\" \"c\" \"d\")")) | ||
| 71 | (shortdoc-function-examples 'delete))) | ||
| 72 | (should (equal '((alist . "(assq 'foo '((foo . bar) (zot . baz)))\n => (foo . bar)") | ||
| 73 | (list . "(assq 'b '((a . 1) (b . 2)))\n => (b . 2)")) | ||
| 74 | (shortdoc-function-examples 'assq))) | ||
| 75 | (should (equal '((regexp . "(string-match-p \"^[fo]+\" \"foobar\")\n => 0")) | ||
| 76 | (shortdoc-function-examples 'string-match-p)))) | ||
| 77 | |||
| 68 | (provide 'shortdoc-tests) | 78 | (provide 'shortdoc-tests) |
| 69 | 79 | ||
| 70 | ;;; shortdoc-tests.el ends here | 80 | ;;; shortdoc-tests.el ends here |