branch: externals/hyperbole
commit f3ea2cb33889e87165ea63406eabb1615a2c1724
Author: Mats Lidell <mats.lid...@lidells.se>
Commit: GitHub <nore...@github.com>

    Remove hywiki-directory when test is done (#691)
---
 ChangeLog            |  5 +++++
 test/hywiki-tests.el | 13 ++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 99015dd4a5..04f8aaa69d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-03-30  Mats Lidell  <ma...@gnu.org>
+
+* test/hywiki-tests.el (hywiki-tests--add-find): Remove hywiki-directory
+    at end of test case.
+
 2025-03-23  Mats Lidell  <ma...@gnu.org>
 
 * test/hywiki-tests.el (hywiki-tests--run-test-case): Run DSL for testing
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index 58373f17fa..7edf503cdd 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -879,11 +879,14 @@ Note special meaning of `hywiki-allow-plurals-flag'."
 
 (ert-deftest hywiki-tests--add-find ()
   "Verify `hywiki-add-find'."
-  (let ((hywiki-directory (make-temp-file "hywiki" t))
-        (wikiword "WikiWord")
-       (referent '(find . hywiki-word-grep)))
-    (hywiki-add-find wikiword)
-    (should (equal referent (hywiki-get-referent wikiword)))))
+  (let* ((hywiki-directory (make-temp-file "hywiki" t))
+         (wikiword "WikiWord")
+        (referent '(find . hywiki-word-grep)))
+    (unwind-protect
+        (progn
+          (hywiki-add-find wikiword)
+          (should (equal referent (hywiki-get-referent wikiword))))
+      (hy-delete-dir-and-buffer hywiki-directory))))
 
 (ert-deftest hywiki-tests--add-global-button ()
   "Verify `hywiki-add-global-button'."

Reply via email to