test-ob-octave.el: wrap get-buffer in buffer-live-p

* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Wrap GET-BUFFER in BUFFER-LIVE-P.
This ensures that a killed buffer does not cause an incorrect failure
of a test.

Link: https://orgmode.org/list/87bknh5nva.fsf@localhost
This commit is contained in:
Leo Butler 2023-01-05 13:53:44 -06:00 committed by Ihor Radchenko
parent 28a9664844
commit 41ebc2e40c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ sombrero;
(org-babel-execute-src-block)
(should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file))
(should-not (get-buffer "*Org-Babel Error Output*")))
(should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
;; clean-up
(delete-file file)
(when (get-buffer "*Org-Babel Error Output*")
@ -99,7 +99,7 @@ sombrero;
(should (get-buffer "*Inferior Octave*"))
(should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file))
(should-not (get-buffer "*Org-Babel Error Output*")))
(should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
;; clean-up
(delete-file file)
(let (kill-buffer-query-functions kill-buffer-hook)
@ -119,7 +119,7 @@ sombrero;
(org-babel-execute-src-block)
(should (search-forward (format "[[file:%s]]" file) nil nil))
(should (file-readable-p file))
(should-not (get-buffer "*Org-Babel Error Output*")))
(should-not (buffer-live-p (get-buffer "*Org-Babel Error Output*"))))
;; clean-up
(delete-file file)
(when (get-buffer "*Org-Babel Error Output*")