branch: externals/hyperbole commit e67d0f733fc8a9f741ea4e5099280bbfeccd3ca5 Author: bw <r...@gnu.org> Commit: bw <r...@gnu.org>
Fix edebugging of tests that have not been previously defined --- ChangeLog | 5 +++++ hypb-ert.el | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 311ab9df5f..2f41b2d8d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2024-01-03 Bob Weiner <r...@gnu.org> +* hypb-ert.el (hypb-ert-run-test-at-definition): Fix to edebug function + when not previously defined. + test/hypb-ert-tests.el (hypb-ert-tests--edebug-is-called): Make edebug + test work. + * hib-debbugs.el (declare-function): Revert declarations to use "ext:debbugs-gnu" from "ext:debbugs" since the newer package does not have many of the functions that Hyperbole presently uses. diff --git a/hypb-ert.el b/hypb-ert.el index ef97904198..52b7c7170d 100644 --- a/hypb-ert.el +++ b/hypb-ert.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell <ma...@gnu.org> and Bob Weiner <r...@gnu.org> ;; ;; Orig-Date: 31-Mar-21 at 21:11:00 -;; Last-Mod: 1-Jan-24 at 13:10:06 by Bob Weiner +;; Last-Mod: 3-Jan-24 at 03:37:28 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -105,14 +105,16 @@ With optional START-END-FLAG, return a list of (test-name start-pos end-pos)." "Assume on the name in the first line of an ert test def, eval and run the test. With optional DEBUG-IT non-nil (when the assist-key is pressed), edebug the test when it is run." - (let (test-sym) - (setq test-sym (intern-soft test-name)) + (let ((test-sym (intern-soft test-name))) ;; Ensure run the latest version of the test, either with the ;; edebugger if already instrumented for it; otherwise, with the ;; normal evaluator. (if (and test-sym debug-it) (edebug-defun) - (eval-defun nil)) + (eval-defun nil) + (setq test-sym (intern-soft test-name)) + (when (and test-sym debug-it) + (edebug-defun))) (setq test-sym (intern-soft test-name)) (when (and test-sym (ert-test-boundp test-sym)) (when (and buffer-file-name (string-prefix-p hyperb:dir buffer-file-name))