aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-06-02 07:31:06 -0700
committerPaul Eggert2015-06-02 07:33:14 -0700
commita158324abdab59ea28f58a4af9311d447d4a1879 (patch)
tree88b4b3b3f9bcbc816e038f508633f170bb2144de
parentc7695d0adb125a3817f3df015137287e801e457a (diff)
downloademacs-a158324abdab59ea28f58a4af9311d447d4a1879.tar.gz
emacs-a158324abdab59ea28f58a4af9311d447d4a1879.zip
Generate curved quotes in ert doc
* lisp/emacs-lisp/ert.el (ert--print-test-for-ewoc) (ert-results-mode-menu) (ert-results-pop-to-backtrace-for-test-at-point) (ert-results-pop-to-messages-for-test-at-point) (ert-results-pop-to-should-forms-for-test-at-point) (ert-describe-test): Quote ‘like this’, not `like this', when generating doc strings and the like. * test/automated/ert-x-tests.el (ert-test-describe-test): Allow quoting ‘like this’.
-rw-r--r--lisp/emacs-lisp/ert.el27
-rw-r--r--test/automated/ert-x-tests.el5
2 files changed, 18 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b678e122c11..99c5ede33a0 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1849,7 +1849,9 @@ non-nil, returns the face for expected results.."
1849 (when (ert-test-documentation test) 1849 (when (ert-test-documentation test)
1850 (insert " " 1850 (insert " "
1851 (propertize 1851 (propertize
1852 (ert--string-first-line (ert-test-documentation test)) 1852 (ert--string-first-line
1853 (substitute-command-keys
1854 (ert-test-documentation test)))
1853 'font-lock-face 'font-lock-doc-face) 1855 'font-lock-face 'font-lock-doc-face)
1854 "\n")) 1856 "\n"))
1855 (cl-etypecase result 1857 (cl-etypecase result
@@ -2063,7 +2065,7 @@ and how to display message."
2063 "--" 2065 "--"
2064 ["Show backtrace" ert-results-pop-to-backtrace-for-test-at-point] 2066 ["Show backtrace" ert-results-pop-to-backtrace-for-test-at-point]
2065 ["Show messages" ert-results-pop-to-messages-for-test-at-point] 2067 ["Show messages" ert-results-pop-to-messages-for-test-at-point]
2066 ["Show `should' forms" ert-results-pop-to-should-forms-for-test-at-point] 2068 ["Show should forms" ert-results-pop-to-should-forms-for-test-at-point]
2067 ["Describe test" ert-results-describe-test-at-point] 2069 ["Describe test" ert-results-describe-test-at-point]
2068 "--" 2070 "--"
2069 ["Delete test" ert-delete-test] 2071 ["Delete test" ert-delete-test]
@@ -2375,9 +2377,9 @@ To be used in the ERT results buffer."
2375 (ert--print-backtrace backtrace) 2377 (ert--print-backtrace backtrace)
2376 (debugger-make-xrefs) 2378 (debugger-make-xrefs)
2377 (goto-char (point-min)) 2379 (goto-char (point-min))
2378 (insert "Backtrace for test `") 2380 (insert "Backtrace for test ")
2379 (ert-insert-test-name-button (ert-test-name test)) 2381 (ert-insert-test-name-button (ert-test-name test))
2380 (insert "':\n"))))))) 2382 (insert ":\n")))))))
2381 2383
2382(defun ert-results-pop-to-messages-for-test-at-point () 2384(defun ert-results-pop-to-messages-for-test-at-point ()
2383 "Display the part of the *Messages* buffer generated during the test at point. 2385 "Display the part of the *Messages* buffer generated during the test at point.
@@ -2396,9 +2398,9 @@ To be used in the ERT results buffer."
2396 (ert-simple-view-mode) 2398 (ert-simple-view-mode)
2397 (insert (ert-test-result-messages result)) 2399 (insert (ert-test-result-messages result))
2398 (goto-char (point-min)) 2400 (goto-char (point-min))
2399 (insert "Messages for test `") 2401 (insert "Messages for test ")
2400 (ert-insert-test-name-button (ert-test-name test)) 2402 (ert-insert-test-name-button (ert-test-name test))
2401 (insert "':\n"))))) 2403 (insert ":\n")))))
2402 2404
2403(defun ert-results-pop-to-should-forms-for-test-at-point () 2405(defun ert-results-pop-to-should-forms-for-test-at-point ()
2404 "Display the list of `should' forms executed during the test at point. 2406 "Display the list of `should' forms executed during the test at point.
@@ -2426,9 +2428,9 @@ To be used in the ERT results buffer."
2426 (ert--pp-with-indentation-and-newline form-description) 2428 (ert--pp-with-indentation-and-newline form-description)
2427 (ert--make-xrefs-region begin (point))))) 2429 (ert--make-xrefs-region begin (point)))))
2428 (goto-char (point-min)) 2430 (goto-char (point-min))
2429 (insert "`should' forms executed during test `") 2431 (insert "should forms executed during test ")
2430 (ert-insert-test-name-button (ert-test-name test)) 2432 (ert-insert-test-name-button (ert-test-name test))
2431 (insert "':\n") 2433 (insert ":\n")
2432 (insert "\n") 2434 (insert "\n")
2433 (insert (concat "(Values are shallow copies and may have " 2435 (insert (concat "(Values are shallow copies and may have "
2434 "looked different during the test if they\n" 2436 "looked different during the test if they\n"
@@ -2505,9 +2507,9 @@ To be used in the ERT results buffer."
2505 (let ((file-name (and test-name 2507 (let ((file-name (and test-name
2506 (symbol-file test-name 'ert-deftest)))) 2508 (symbol-file test-name 'ert-deftest))))
2507 (when file-name 2509 (when file-name
2508 (insert " defined in `" (file-name-nondirectory file-name) "'") 2510 (insert " defined in " (file-name-nondirectory file-name) "")
2509 (save-excursion 2511 (save-excursion
2510 (re-search-backward "`\\([^`']+\\)'" nil t) 2512 (re-search-backward "\\([^‘’]+\\)" nil t)
2511 (help-xref-button 1 'help-function-def test-name file-name))) 2513 (help-xref-button 1 'help-function-def test-name file-name)))
2512 (insert ".") 2514 (insert ".")
2513 (fill-region-as-paragraph (point-min) (point)) 2515 (fill-region-as-paragraph (point-min) (point))
@@ -2519,8 +2521,9 @@ To be used in the ERT results buffer."
2519 "this documentation refers to an old definition.") 2521 "this documentation refers to an old definition.")
2520 (fill-region-as-paragraph begin (point))) 2522 (fill-region-as-paragraph begin (point)))
2521 (insert "\n\n")) 2523 (insert "\n\n"))
2522 (insert (or (ert-test-documentation test-definition) 2524 (insert (substitute-command-keys
2523 "It is not documented.") 2525 (or (ert-test-documentation test-definition)
2526 "It is not documented."))
2524 "\n"))))))) 2527 "\n")))))))
2525 2528
2526(defun ert-results-describe-test-at-point () 2529(defun ert-results-describe-test-at-point ()
diff --git a/test/automated/ert-x-tests.el b/test/automated/ert-x-tests.el
index 81d0f7c65c6..617213386e2 100644
--- a/test/automated/ert-x-tests.el
+++ b/test/automated/ert-x-tests.el
@@ -195,8 +195,9 @@
195 (let ((case-fold-search nil)) 195 (let ((case-fold-search nil))
196 (should (string-match (concat 196 (should (string-match (concat
197 "\\`ert-test-describe-test is a test" 197 "\\`ert-test-describe-test is a test"
198 " defined in `ert-x-tests.elc?'\\.\n\n" 198 " defined in"
199 "Tests `ert-describe-test'\\.\n\\'") 199 " [`‘]ert-x-tests.elc?['’]\\.\n\n"
200 "Tests [`‘]ert-describe-test['’]\\.\n\\'")
200 (buffer-string))))))))) 201 (buffer-string)))))))))
201 202
202(ert-deftest ert-test-message-log-truncation () 203(ert-deftest ert-test-message-log-truncation ()