emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/idris-mode ac9ebf0159 07/13: Ensure that idris connection


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode ac9ebf0159 07/13: Ensure that idris connection is closed in `idris-test-proof-search`
Date: Thu, 5 Jan 2023 04:59:25 -0500 (EST)

branch: elpa/idris-mode
commit ac9ebf015954f57e06c03e396f26ccaa07842ba0
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Ensure that idris connection is closed in `idris-test-proof-search`
    
    Why:
    In Idris2 the test is expected to fail but unfortunately that
    also meant the Idris connection was not closed and leaked to other tests
    causing unexpected failures.
---
 idris-tests.el | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/idris-tests.el b/idris-tests.el
index 2d79f4162c..2802c207f9 100644
--- a/idris-tests.el
+++ b/idris-tests.el
@@ -134,24 +134,25 @@ remain."
   :expected-result (if (string-match-p "idris2" idris-interpreter-path)
                        :failed
                      :passed)
-  (let ((buffer (find-file "test-data/ProofSearch.idr")))
-    (with-current-buffer buffer
-      (idris-load-file)
-      (dotimes (_ 5) (accept-process-output nil 1))
-      (goto-char (point-min))
-      (re-search-forward "search_here")
-      (goto-char (match-beginning 0))
-      (idris-proof-search)
-      (dotimes (_ 5) (accept-process-output nil 1))
-      (should (looking-at-p "lteSucc (lteSucc (lteSucc (lteSucc (lteSucc 
lteZero))))"))
-      (move-beginning-of-line nil)
-      (delete-region (point) (line-end-position))
-      (insert "prf = ?search_here")
-      (save-buffer)
-      (kill-buffer)))
-
-  ;; More cleanup
-  (idris-quit))
+  (unwind-protect
+      (let ((buffer (find-file "test-data/ProofSearch.idr")))
+        (with-current-buffer buffer
+          (idris-load-file)
+          (dotimes (_ 5) (accept-process-output nil 1))
+          (goto-char (point-min))
+          (re-search-forward "search_here")
+          (goto-char (match-beginning 0))
+          (idris-proof-search)
+          (dotimes (_ 5) (accept-process-output nil 1))
+          (should (looking-at-p "lteSucc (lteSucc (lteSucc (lteSucc (lteSucc 
lteZero))))"))
+          (move-beginning-of-line nil)
+          (delete-region (point) (line-end-position))
+          (insert "prf = ?search_here")
+          (save-buffer)
+          (kill-buffer)))
+
+    ;; More cleanup
+    (idris-quit)))
 
 (ert-deftest idris-test-find-cmdline-args ()
   "Test that idris-mode calculates command line arguments from .ipkg files."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]