From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yJ1bG7y5yl6IcwAA0tVLHw (envelope-from ) for ; Sun, 24 May 2020 18:15:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GMJPF7y5yl43IAAAB5/wlQ (envelope-from ) for ; Sun, 24 May 2020 18:15:24 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F3D5C9404CC for ; Sun, 24 May 2020 18:15:23 +0000 (UTC) Received: from localhost ([::1]:45880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcv9f-0005Fv-0g for larch@yhetil.org; Sun, 24 May 2020 14:15:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcv9H-0005Fe-9G for emacs-orgmode@gnu.org; Sun, 24 May 2020 14:14:59 -0400 Received: from mout-p-103.mailbox.org ([2001:67c:2050::465:103]:47620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1jcv9F-0004Aj-RL; Sun, 24 May 2020 14:14:58 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 49VT0F2pKKzKmWR; Sun, 24 May 2020 20:14:53 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id g7ojEG_g38VL; Sun, 24 May 2020 20:14:50 +0200 (CEST) From: Kevin Foley To: Kyle Meyer , Bastien Subject: Re: [PATCH] Fix `org-babel-detangle' handling of false positives In-Reply-To: <87wo515mu6.fsf@kyleam.com> References: <8736buek6n.fsf@gnu.org> <87h7zzdkqo.fsf@gnu.org> <87y2pk7zhn.fsf@gnu.org> <87wo51moo1.fsf@gnu.org> <87wo515mu6.fsf@kyleam.com> Date: Sun, 24 May 2020 14:14:45 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 5218C175C X-Rspamd-Score: -4.53 / 15.00 / 15.00 Received-SPF: pass client-ip=2001:67c:2050::465:103; envelope-from=kevin@kevinjfoley.me; helo=mout-p-103.mailbox.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: QPuuzPWi3dQ9 Kyle Meyer writes: > Kevin, could you look into updating the test to avoid changing the repo > state? Sorry about that. Do you have any suggestions on how to avoid changing the state or any examples of similar tests? I tried the following to replace the file with it's original contents but it doesn't seem to be working as I intend. I also worry it's a convoluted approach and there may be a simpler way. diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index ed75e6ca4..a91bd3446 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -384,12 +384,19 @@ (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"))))) + (let* ((babel-org-file (expand-file-name "babel.org" org-test-example-dir)) + (orig-file-buffer + (get-buffer-create " bable-org"))) + (with-current-buffer orig-file-buffer (insert-file-contents babel-org-file)) + (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")))) + (with-current-buffer orig-file-buffer + (kill-buffer (get-file-buffer babel-org-file)) + (write-region (point-min) (point-max) babel-org-file)))) (provide 'test-ob-tangle) Thanks, Kevin