[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/handler-bind dcf7508c947 04/10: emacs-module-tests.el (mod-test-
From: |
Stefan Monnier |
Subject: |
scratch/handler-bind dcf7508c947 04/10: emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test |
Date: |
Thu, 28 Dec 2023 01:17:41 -0500 (EST) |
branch: scratch/handler-bind
commit dcf7508c947359866151171a840d99d939c35cdf
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test
That test relied on `debugger` and `debug-on-signal` in a way that
doesn't work with the new ERT code.
* test/src/emacs-module-tests.el (mod-test-non-local-exit-signal-test):
Use `handler-bind` rather than the debugger.
---
test/src/emacs-module-tests.el | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 59af5d9a4a8..2dac5063840 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -114,15 +114,14 @@ changes."
(ert-deftest mod-test-non-local-exit-signal-test ()
(should-error (mod-test-signal))
- (let (debugger-args backtrace)
+ (let (handler-err backtrace)
(should-error
- (let ((debugger (lambda (&rest args)
- (setq debugger-args args
- backtrace (with-output-to-string (backtrace)))
- (cl-incf num-nonmacro-input-events)))
- (debug-on-signal t))
+ (handler-bind
+ ((error (lambda (err)
+ (setq handler-err err
+ backtrace (with-output-to-string (backtrace))))))
(mod-test-signal)))
- (should (equal debugger-args '(error (error . 56))))
+ (should (equal handler-err '(error . 56)))
(should (string-match-p
(rx bol " mod-test-signal()" eol)
backtrace))))
- branch scratch/handler-bind created (now 26b7078705a), Stefan Monnier, 2023/12/28
- scratch/handler-bind 89a298b3d2f 02/10: Fix ert-tests.el for the new `handler-bind` code, Stefan Monnier, 2023/12/28
- scratch/handler-bind dcf7508c947 04/10: emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test,
Stefan Monnier <=
- scratch/handler-bind 1c1d2eb3e38 03/10: Use handler-bind to repair bytecomp-tests, Stefan Monnier, 2023/12/28
- scratch/handler-bind 6a57b9151b1 06/10: Move batch backtrace code to `top_level_2`, Stefan Monnier, 2023/12/28
- scratch/handler-bind ae21819496a 01/10: ert.el: Use `handler-bind` to record backtraces, Stefan Monnier, 2023/12/28
- scratch/handler-bind 26b7078705a 10/10: (backtrace-on-redisplay-error): Use `handler-bind`, Stefan Monnier, 2023/12/28
- scratch/handler-bind b925152bffc 09/10: (signal_or_quit): Preserve error object identity, Stefan Monnier, 2023/12/28
- scratch/handler-bind 917596160c1 05/10: startup.el: Use `handler-bind` to implement `--debug-init`, Stefan Monnier, 2023/12/28
- scratch/handler-bind 634bf619476 07/10: (macroexp--with-extended-form-stack): Use plain `let`, Stefan Monnier, 2023/12/28
- scratch/handler-bind c89b234405f 08/10: eval.c: Add new var `lisp-eval-depth-reserve`, Stefan Monnier, 2023/12/28