emacs-diffs
[Top][All Lists]
Advanced

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

master a054c4aa4a5: More fixes to Eglot tests


From: João Távora
Subject: master a054c4aa4a5: More fixes to Eglot tests
Date: Tue, 14 Mar 2023 20:35:09 -0400 (EDT)

branch: master
commit a054c4aa4a5d42e7abe01f181a40a630f0df2b87
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    More fixes to Eglot tests
    
    * test/lisp/progmodes/eglot-tests.el
    (eglot-test-project-wide-diagnostics-rust-analyzer): Make even more
    robust.
    (eglot--wait-for): flush-standard-output doesn't exist in older
    Emacsen.
    (eglot-test-basic-diagnostics): Increase timeout.
---
 test/lisp/progmodes/eglot-tests.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/lisp/progmodes/eglot-tests.el 
b/test/lisp/progmodes/eglot-tests.el
index d5f0f02fc6b..b95e527c510 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -281,8 +281,11 @@ then restored."
                      do
                      ;; `read-event' is essential to have the file
                      ;; watchers come through.
-                     (read-event nil nil 0.1)
-                     (princ ".") (flush-standard-output)
+                     (cond ((fboundp 'flush-standard-output)
+                            (read-event nil nil 0.1) (princ ".")
+                            (flush-standard-output))
+                           (t
+                            (read-event "." nil 0.1)))
                      (accept-process-output nil 0.1))))
        (setq ,events-sym (cdr events))
        (cl-destructuring-bind (&key method id &allow-other-keys) (car events)
@@ -441,7 +444,7 @@ then restored."
         (eglot--find-file-noselect "diag-project/main.c")
       (eglot--sniffing (:server-notifications s-notifs)
         (eglot--tests-connect)
-        (eglot--wait-for (s-notifs 2)
+        (eglot--wait-for (s-notifs 10)
             (&key _id method &allow-other-keys)
           (string= method "textDocument/publishDiagnostics"))
         (flymake-start)
@@ -826,9 +829,10 @@ pylsp prefers autopep over yafp, despite its README 
stating the contrary."
         (eglot--sniffing (:server-notifications s-notifs)
           (eglot--tests-connect)
           (flymake-start)
-          (eglot--wait-for (s-notifs 10)
-              (&key _id method &allow-other-keys)
-            (string= method "textDocument/publishDiagnostics"))
+          (eglot--wait-for (s-notifs 15)
+              (&key _id method params &allow-other-keys)
+            (and (string= method "textDocument/publishDiagnostics")
+                 (string-suffix-p "main.rs" (plist-get params :uri))))
           (let* ((diags (flymake--project-diagnostics)))
             (should (cl-some (lambda (diag)
                                (let ((locus (flymake-diagnostic-buffer diag)))



reply via email to

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