emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kevin Foley <kevin@kevinjfoley.me>
To: emacs-orgmode@gnu.org
Cc: Bastien <bzg@gnu.org>
Subject: [PATCH] test-ob-tangle.el: Fix dirty repo state caused by testing
Date: Tue, 26 May 2020 20:47:53 -0400	[thread overview]
Message-ID: <m2lflecifa.fsf@Kevins-MacBook-Pro.local.i-did-not-set--mail-host-address--so-tickle-me> (raw)

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


The attached patch kills the buffer of the file modified
during testing to prevent leaving the repo in a dirty state.

Thanks to Kyle for seeing this and providing guidance on how to
address.

Thanks,
Kevin


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-test-ob-tangle.el-Fix-dirty-repo-state-caused-by-tes.patch --]
[-- Type: text/x-patch, Size: 1635 bytes --]

From 46dd1cf3c34a372612e4a67a79afd84ca3317500 Mon Sep 17 00:00:00 2001
From: "Kevin J. Foley" <kevin@kevinjfoley.me>
Date: Tue, 26 May 2020 20:42:54 -0400
Subject: [PATCH] test-ob-tangle.el: Fix dirty repo state caused by testing

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Kill modified buffer after test.

Another test is causing the modifications to be saved which leaves the
repo in a dirty state after testing.
---
 testing/lisp/test-ob-tangle.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index ed75e6ca4..bd2d99ca2 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -384,12 +384,14 @@ (ert-deftest ob-tangle/commented-src-blocks ()

 (ert-deftest ob-tangle/detangle-false-positive ()
   "Test handling of false positive link during detangle."
-  (org-test-in-example-file (expand-file-name "babel.el" org-test-example-dir)
-    (org-babel-detangle)
-    (org-test-at-id "73115FB0-6565-442B-BB95-50195A499EF4"
-    (org-babel-next-src-block)
-    (should (equal (string-trim (org-element-property :value (org-element-at-point)))
-		   ";; detangle changes")))))
+  (unwind-protect
+      (org-test-in-example-file (expand-file-name "babel.el" org-test-example-dir)
+	(org-babel-detangle)
+	(org-test-at-id "73115FB0-6565-442B-BB95-50195A499EF4"
+	  (org-babel-next-src-block)
+	  (should (equal (string-trim (org-element-property :value (org-element-at-point)))
+			 ";; detangle changes"))))
+    (kill-buffer "babel.org")))

 (provide 'test-ob-tangle)

--
2.19.0

             reply	other threads:[~2020-05-27  0:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27  0:47 Kevin Foley [this message]
2020-05-27  2:05 ` [PATCH] test-ob-tangle.el: Fix dirty repo state caused by testing Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lflecifa.fsf@Kevins-MacBook-Pro.local.i-did-not-set--mail-host-address--so-tickle-me \
    --to=kevin@kevinjfoley.me \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).