]> git.eshelyaron.com Git - emacs.git/commitdiff
Recreate symptom of Bug#42701.
authorPhilipp Stephani <phst@google.com>
Tue, 18 May 2021 16:43:11 +0000 (18:43 +0200)
committerPhilipp Stephani <phst@google.com>
Tue, 18 May 2021 16:43:11 +0000 (18:43 +0200)
The fix to Bug#48489 (commit 9676d41b8301b84e07717e633059a3f2b5c4c9d8)
has masked the symptom of Bug#42701 for 'if-let'.  Create a helper
macro that still exemplifies the bug.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--duplicate-symbol-backtrack): New helper macro.
(edebug-tests-duplicate-symbol-backtrack): Use it instead of 'if-let'.

test/lisp/emacs-lisp/edebug-tests.el

index 7d45432e57e9b23d242f5848c03262f38def2814..2f45050e2ebfe4fd9c337d6178f9b1b709497b99 100644 (file)
@@ -1029,14 +1029,21 @@ clashes (Bug#41853)."
                                     inner@cl-flet@10002
                                     edebug-tests-cl-flet-2)))))))
 
+(defmacro edebug-tests--duplicate-symbol-backtrack (arg)
+  "Helper macro that exemplifies Bug#42701.
+ARG is either (FORM) or (FORM IGNORED)."
+  (declare (debug ([&or (form) (form sexp)])))
+  (car arg))
+
 (ert-deftest edebug-tests-duplicate-symbol-backtrack ()
   "Check that Edebug doesn't create duplicate symbols when
 backtracking (Bug#42701)."
   (with-temp-buffer
-    (dolist (form '((require 'subr-x)
-                    (defun edebug-tests-duplicate-symbol-backtrack ()
-                      (if-let (x (funcall (lambda (y) 1) 2)) 3 4))))
-      (print form (current-buffer)))
+    (print '(defun edebug-tests-duplicate-symbol-backtrack ()
+              (edebug-tests--duplicate-symbol-backtrack
+               ;; Passing (FORM IGNORED) forces backtracking.
+               ((lambda () 123) ignored)))
+           (current-buffer))
     (let* ((edebug-all-defs t)
            (edebug-initial-mode 'Go-nonstop)
            (instrumented-names ())