]> git.eshelyaron.com Git - emacs.git/commitdiff
Test that buffer exists in shortdoc-all-groups-work
authorStefan Kangas <stefan@marxist.se>
Tue, 4 Jan 2022 02:50:59 +0000 (03:50 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 4 Jan 2022 02:52:42 +0000 (03:52 +0100)
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-all-groups-work): Test that the shortdoc buffer was created.

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

index 326d43eead47ba3e9aaa2e96b7b3716c71875e72..8515b9fdfb95942e44d77fe98598ddb98198092c 100644 (file)
 (ert-deftest shortdoc-all-groups-work ()
   "Test that all defined shortdoc groups display correctly."
   (dolist (group (mapcar (lambda (x) (car x)) shortdoc--groups))
-    (unwind-protect
-        (shortdoc-display-group group)
-      (when-let ((buf (get-buffer (format "*Shortdoc %s*" group))))
-        (kill-buffer buf)))))
+    (let ((buf-name (format "*Shortdoc %s*" group)) buf)
+      (unwind-protect
+          (progn
+            (shortdoc-display-group group)
+            (should (setq buf (get-buffer buf-name))))
+        (when buf
+          (kill-buffer buf))))))
 
 (provide 'shortdoc-tests)