(defun ert-get-test (symbol)
"If SYMBOL names a test, return that. Signal an error otherwise."
- (unless (ert-test-boundp symbol) (error "No test named `%S'" symbol))
+ (unless (ert-test-boundp symbol) (error "No test named ‘%S’" symbol))
(get symbol 'ert--test))
(defun ert-set-test (symbol definition)
(defun ert--special-operator-p (thing)
"Return non-nil if THING is a symbol naming a special operator."
(and (symbolp thing)
- (let ((definition (ignore-errors (indirect-function thing))))
+ (let ((definition (indirect-function thing)))
(and (subrp definition)
(eql (cdr (subr-arity definition)) 'unevalled)))))
(when (ert-test-documentation test)
(insert " "
(propertize
- (ert--string-first-line (ert-test-documentation test))
+ (ert--string-first-line
+ (substitute-command-keys
+ (ert-test-documentation test)))
'font-lock-face 'font-lock-doc-face)
"\n"))
(cl-etypecase result
"--"
["Show backtrace" ert-results-pop-to-backtrace-for-test-at-point]
["Show messages" ert-results-pop-to-messages-for-test-at-point]
- ["Show `should' forms" ert-results-pop-to-should-forms-for-test-at-point]
+ ["Show ‘should’ forms" ert-results-pop-to-should-forms-for-test-at-point]
["Describe test" ert-results-describe-test-at-point]
"--"
["Delete test" ert-delete-test]
(ert--print-backtrace backtrace)
(debugger-make-xrefs)
(goto-char (point-min))
- (insert "Backtrace for test `")
+ (insert "Backtrace for test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")))))))
+ (insert "’:\n")))))))
(defun ert-results-pop-to-messages-for-test-at-point ()
"Display the part of the *Messages* buffer generated during the test at point.
(ert-simple-view-mode)
(insert (ert-test-result-messages result))
(goto-char (point-min))
- (insert "Messages for test `")
+ (insert "Messages for test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")))))
+ (insert "’:\n")))))
(defun ert-results-pop-to-should-forms-for-test-at-point ()
"Display the list of `should' forms executed during the test at point.
(ert--pp-with-indentation-and-newline form-description)
(ert--make-xrefs-region begin (point)))))
(goto-char (point-min))
- (insert "`should' forms executed during test `")
+ (insert "‘should’ forms executed during test ‘")
(ert-insert-test-name-button (ert-test-name test))
- (insert "':\n")
+ (insert "’:\n")
(insert "\n")
(insert (concat "(Values are shallow copies and may have "
"looked different during the test if they\n"
(let ((file-name (and test-name
(symbol-file test-name 'ert-deftest))))
(when file-name
- (insert " defined in `" (file-name-nondirectory file-name) "'")
+ (insert " defined in ‘" (file-name-nondirectory file-name) "’")
(save-excursion
- (re-search-backward "`\\([^`']+\\)'" nil t)
+ (re-search-backward "‘\\([^‘’]+\\)’" nil t)
(help-xref-button 1 'help-function-def test-name file-name)))
(insert ".")
(fill-region-as-paragraph (point-min) (point))
"this documentation refers to an old definition.")
(fill-region-as-paragraph begin (point)))
(insert "\n\n"))
- (insert (or (ert-test-documentation test-definition)
- "It is not documented.")
+ (insert (substitute-command-keys
+ (or (ert-test-documentation test-definition)
+ "It is not documented."))
"\n")))))))
(defun ert-results-describe-test-at-point ()
(add-to-list 'minor-mode-alist '(ert--current-run-stats
(:eval
(ert--tests-running-mode-line-indicator))))
-(add-to-list 'emacs-lisp-mode-hook 'ert--activate-font-lock-keywords)
+(add-hook 'emacs-lisp-mode-hook #'ert--activate-font-lock-keywords)
(defun ert--unload-function ()
"Unload function to undo the side-effects of loading ert.el."
nil)
(defvar ert-unload-hook '())
-(add-hook 'ert-unload-hook 'ert--unload-function)
+(add-hook 'ert-unload-hook #'ert--unload-function)
(provide 'ert)