branch: externals/urgrep
commit 01fbe92f2cb4f07920fa4b5b2b6b6203f9d44dbb
Author: Jim Porter <jporterb...@gmail.com>
Commit: Jim Porter <jporterb...@gmail.com>

    In tests, wait for grep to finish before doing any checks
    
    This ensures that a failing test doesn't prompt about killing the process.
---
 urgrep-tests.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/urgrep-tests.el b/urgrep-tests.el
index 6e4c58f90a..ac7434053a 100644
--- a/urgrep-tests.el
+++ b/urgrep-tests.el
@@ -570,12 +570,12 @@ joined to compare against COMMAND."
 
 (ert-deftest urgrep-tests/urgrep/group ()
   (switch-to-buffer (urgrep "urgrep"))
+  (while (get-buffer-process (current-buffer))
+    (sit-for 0.01))
   (should (and (equal urgrep-current-tool (urgrep-get-tool))
                (local-variable-p 'urgrep-current-tool)))
   (should (and (equal urgrep-current-query '("urgrep"))
                (local-variable-p 'urgrep-current-query)))
-  (while (get-buffer-process (current-buffer))
-    (sit-for 0.01))
   (goto-char (point-min))
   (re-search-forward "urgrep-tests.el")
   (beginning-of-line 2)
@@ -583,24 +583,24 @@ joined to compare against COMMAND."
 
 (ert-deftest urgrep-tests/urgrep/no-group ()
   (switch-to-buffer (urgrep "urgrep" :group nil))
+  (while (get-buffer-process (current-buffer))
+    (sit-for 0.01))
   (should (and (equal urgrep-current-tool (urgrep-get-tool))
                (local-variable-p 'urgrep-current-tool)))
   (should (and (equal urgrep-current-query '("urgrep" :group nil))
                (local-variable-p 'urgrep-current-query)))
-  (while (get-buffer-process (current-buffer))
-    (sit-for 0.01))
   (goto-char (point-min))
   (re-search-forward "urgrep-tests.el:")
   (urgrep-tests/check-match-at-point))
 
 (ert-deftest urgrep-tests/urgrep-run-command ()
   (switch-to-buffer (urgrep-run-command (urgrep-command "urgrep") nil nil))
+  (while (get-buffer-process (current-buffer))
+    (sit-for 0.01))
   (should (and (equal urgrep-current-tool (urgrep-get-tool))
                (local-variable-p 'urgrep-current-tool)))
   (should (and (equal urgrep-current-query (urgrep-command "urgrep"))
                (local-variable-p 'urgrep-current-query)))
-  (while (get-buffer-process (current-buffer))
-    (sit-for 0.01))
   (goto-char (point-min))
   (re-search-forward "urgrep-tests.el")
   (beginning-of-line 2)

Reply via email to