emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
@ 2023-07-16 12:36 Evgenii Klimov
  2023-07-17  9:00 ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Evgenii Klimov @ 2023-07-16 12:36 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
the buffer, connected to testing/examples/babel.org file, that is
modified during the couse of the test.

Way to reproduce the bug (from projects main dir):

#+BEGIN_SRC sh :dir (expand-file-name ".")
emacs -Q \
      -L lisp/ -L testing/ -L testing/lisp -l lisp/org.el \
      -l lisp/org-id.el -l testing/org-test.el -l testing/lisp/test-ob-tangle.el \
      --eval "(progn (org-reload) (setq org-confirm-babel-evaluate nil) \
      (org-babel-do-load-languages 'org-babel-load-languages \
      '((emacs-lisp . t) (shell . t) (org . t))))" \
      --eval '(ert "ob-tangle/detangle-false-positive")'
#+END_SRC


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testing-lisp-test-ob-tangle.el-Avoid-interaction-in-.patch --]
[-- Type: text/x-diff, Size: 1054 bytes --]

From 5905e37a581d4cf2a4a517593c91730d836b6471 Mon Sep 17 00:00:00 2001
From: Evgenii Klimov <eugene.dev@lipklim.org>
Date: Sun, 16 Jul 2023 13:14:38 +0100
Subject: [PATCH] testing/lisp/test-ob-tangle.el: Avoid interaction in test

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Unset modification flag from buffer to kill
(testing/examples/babel.org) in tear down step of test to avoid Emacs
asking for confirmation during interactive testing from within Emacs.
---
 testing/lisp/test-ob-tangle.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index b1b0a0a53..07e75f4d3 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -565,6 +565,8 @@ another block
 	    (should (equal (string-trim (org-element-property
 					 :value (org-element-at-point)))
 			   ";; detangle changes"))))
+      (with-current-buffer buffer
+        (set-buffer-modified-p nil))
       (kill-buffer buffer))))
 
 (provide 'test-ob-tangle)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-07-21 17:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-16 12:36 [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~ Evgenii Klimov
2023-07-17  9:00 ` Ihor Radchenko
2023-07-17 11:53   ` Evgenii Klimov
2023-07-17 12:46     ` Ihor Radchenko
2023-07-20 22:11   ` Evgenii Klimov
2023-07-21  7:45     ` Ihor Radchenko
2023-07-21  9:52       ` Bastien Guerry
2023-07-21  9:55         ` Ihor Radchenko
2023-07-21 13:42           ` Evgenii Klimov
2023-07-21 17:03   ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).