aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGemini Lasswell2018-07-21 12:27:32 -0700
committerGemini Lasswell2018-08-03 08:54:08 -0700
commit3cd6a6846b5f8f67216eba61b761a0e1daff7895 (patch)
treeaa3c4afdb3b943234eb6e1eab09e8ac86410fd18 /test
parent83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b (diff)
downloademacs-3cd6a6846b5f8f67216eba61b761a0e1daff7895.tar.gz
emacs-3cd6a6846b5f8f67216eba61b761a0e1daff7895.zip
Give two backtrace-mode commands better names
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Update bindings and menu items with new function names. (backtrace-collapse, backtrace-pretty-print) (backtrace--collapse, backtrace--pretty-print): Remove functions. (backtrace-single-line, backtrace-multi-line) (backtrace--single-line, backtrace--multi-line): New functions. (backtrace--reformat-sexp): Remove 'error-message' argument. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--pretty-print-and-collapse): Remove. (backtrace-tests--single-and-multi-line): New test. (backtrace-tests--verify-pp-and-collapse): Remove. (backtrace-tests--verify-single-and-multi-line): New function.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/backtrace-tests.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/lisp/emacs-lisp/backtrace-tests.el b/test/lisp/emacs-lisp/backtrace-tests.el
index ff26112ab9a..edd45c770c5 100644
--- a/test/lisp/emacs-lisp/backtrace-tests.el
+++ b/test/lisp/emacs-lisp/backtrace-tests.el
@@ -222,9 +222,9 @@
222 (goto-char (point-max)) 222 (goto-char (point-max))
223 (should-error (backtrace-forward-frame))))) 223 (should-error (backtrace-forward-frame)))))
224 224
225(ert-deftest backtrace-tests--pretty-print-and-collapse () 225(ert-deftest backtrace-tests--single-and-multi-line ()
226 "Forms in backtrace frames can be pretty-printed and collapsed." 226 "Forms in backtrace frames can be on a single line or on multiple lines."
227 (ert-with-test-buffer (:name "pp-and-collapse") 227 (ert-with-test-buffer (:name "single-multi-line")
228 (let* ((arg '(lambda (x) ; Quote this so it isn't made into a closure. 228 (let* ((arg '(lambda (x) ; Quote this so it isn't made into a closure.
229 (let ((number (1+ x))) 229 (let ((number (1+ x)))
230 (+ x number)))) 230 (+ x number))))
@@ -249,25 +249,25 @@
249 results)) 249 results))
250 ;; Check pp and collapse for the form in the header. 250 ;; Check pp and collapse for the form in the header.
251 (goto-char (point-min)) 251 (goto-char (point-min))
252 (backtrace-tests--verify-pp-and-collapse header) 252 (backtrace-tests--verify-single-and-multi-line header)
253 ;; Check pp and collapse for the last frame. 253 ;; Check pp and collapse for the last frame.
254 (goto-char (point-max)) 254 (goto-char (point-max))
255 (backtrace-backward-frame) 255 (backtrace-backward-frame)
256 (backtrace-tests--verify-pp-and-collapse last-line) 256 (backtrace-tests--verify-single-and-multi-line last-line)
257 ;; Check pp and collapse for local variables in the last line. 257 ;; Check pp and collapse for local variables in the last line.
258 (goto-char (point-max)) 258 (goto-char (point-max))
259 (backtrace-backward-frame) 259 (backtrace-backward-frame)
260 (backtrace-toggle-locals) 260 (backtrace-toggle-locals)
261 (forward-line) 261 (forward-line)
262 (backtrace-tests--verify-pp-and-collapse last-line-locals)))) 262 (backtrace-tests--verify-single-and-multi-line last-line-locals))))
263 263
264(defun backtrace-tests--verify-pp-and-collapse (line) 264(defun backtrace-tests--verify-single-and-multi-line (line)
265 "Verify that `backtrace-pretty-print' and `backtrace-collapse' work at point. 265 "Verify that `backtrace-single-line' and `backtrace-multi-line' work at point.
266Point should be at the beginning of a line, and LINE should be a 266Point should be at the beginning of a line, and LINE should be a
267string containing the text of the line at point. Assume that the 267string containing the text of the line at point. Assume that the
268line contains the strings \"lambda\" and \"number\"." 268line contains the strings \"lambda\" and \"number\"."
269 (let ((pos (point))) 269 (let ((pos (point)))
270 (backtrace-pretty-print) 270 (backtrace-multi-line)
271 ;; Verify point is still at the start of the line. 271 ;; Verify point is still at the start of the line.
272 (should (= pos (point)))) 272 (should (= pos (point))))
273 273
@@ -276,7 +276,7 @@ line contains the strings \"lambda\" and \"number\"."
276 (search-forward "number") 276 (search-forward "number")
277 (should-not (= pos (point-at-bol)))) 277 (should-not (= pos (point-at-bol))))
278 ;; Collapse the form. 278 ;; Collapse the form.
279 (backtrace-collapse) 279 (backtrace-single-line)
280 ;; Verify that the form is now back on one line, 280 ;; Verify that the form is now back on one line,
281 ;; and that point is at the same place. 281 ;; and that point is at the same place.
282 (should (string= (backtrace-tests--get-substring 282 (should (string= (backtrace-tests--get-substring