From 47735e0243ba15a485e1a6f25be53f6e42dafa24 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 25 Feb 2026 20:51:21 -0500 Subject: [PATCH] Repair another test bollixed by aggressive optimization. --- test/src/eval-tests.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 29492d5954d..1cb6dcea43e 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -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 ()