Repair another test bollixed by aggressive optimization.

This commit is contained in:
Eric S. Raymond 2026-02-25 20:51:21 -05:00
parent ca42055b0c
commit 47735e0243

View file

@ -533,12 +533,16 @@ expressions works for identifiers starting with period."
(should (listp frames))
(should found)))
(defvar eval-tests--backtrace-eval-dyn)
(defun eval-tests--backtrace-eval-helper ()
(backtrace-eval 'eval-tests--backtrace-eval-dyn 1 'backtrace-eval))
(ert-deftest eval-tests--backtrace-eval ()
(let ((eval-tests--backtrace-eval-lex 42))
(ignore eval-tests--backtrace-eval-lex)
(should (= (backtrace-eval 'eval-tests--backtrace-eval-lex
1 'backtrace-eval)
42))))
(let ((eval-tests--backtrace-eval-dyn 42))
;; Ensure the binding is established before the target frame.
;; backtrace-eval temporarily unrewinds the specpdl to the frame it
;; evaluates in, which would otherwise undo this binding.
(should (= (eval-tests--backtrace-eval-helper) 42))))
(defvar eval-tests--backtrace-locals-dyn)
(defun eval-tests--backtrace-locals-helper ()