]> git.eshelyaron.com Git - emacs.git/commitdiff
; Tag ERC multiline blanks test as :expensive
authorF. Jason Park <jp@neverwas.me>
Wed, 10 Jul 2024 22:36:38 +0000 (15:36 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 11 Jul 2024 14:39:06 +0000 (16:39 +0200)
* test/lisp/erc/erc-tests.el
(erc--check-prompt-input-for-multiline-blanks): Move message-capturing
business outside of primary fixture.  Extend subprocess sleep duration
to 5m.  Delete some unreachable code.  (Bug#72004)

(cherry picked from commit ef3f26ec02d49f00a14e8744ba06208773588c62)

test/lisp/erc/erc-tests.el

index f4cff06f942d86154c5e55ac3393f576f9c0d05a..f65c149608775c1a0f121b4e0b6a403fabbd95aa 100644 (file)
   '("Stripping" "Padding"))
 
 (ert-deftest erc--check-prompt-input-for-multiline-blanks ()
-  (erc-tests-common-with-process-input-spy
-   (lambda (next)
-     (erc-tests-common-init-server-proc "sleep" "10")
-     (should-not erc-send-whitespace-lines)
-     (should erc-warn-about-blank-lines)
-
-     (pcase-dolist (`((,wb ,sw) . ,ex) erc-tests--check-prompt-input--expect)
-       (let ((print-escape-newlines t)
-             (erc-warn-about-blank-lines (eq wb '+wb))
-             (erc-send-whitespace-lines (eq sw '+sw))
-             (samples '("" " " "\n" "\n " " \n" "\n\n"
-                        "a\n" "a\n " "a\n \nb")))
-         (setq ex `(,@ex (a) (a b)) ; baseline, same for all combos
-               samples `(,@samples "a" "a\nb"))
-         (dolist (input samples)
-           (insert input)
-           (ert-info ((format "Opts: %S, Input: %S, want: %S"
-                              (list wb sw) input (car ex)))
-             (ert-with-message-capture messages
+  :tags '(:expensive-test)
+  (ert-with-message-capture messages
+    (erc-tests-common-with-process-input-spy
+     (lambda (next)
+       (erc-tests-common-init-server-proc "sleep" "300")
+       (should-not erc-send-whitespace-lines)
+       (should erc-warn-about-blank-lines)
+
+       (pcase-dolist (`((,wb ,sw) . ,ex) erc-tests--check-prompt-input--expect)
+         (let ((print-escape-newlines t)
+               (erc-warn-about-blank-lines (eq wb '+wb))
+               (erc-send-whitespace-lines (eq sw '+sw))
+               (samples '("" " " "\n" "\n " " \n" "\n\n"
+                          "a\n" "a\n " "a\n \nb")))
+           (setq ex `(,@ex (a) (a b)) ; baseline, same for all combos
+                 samples `(,@samples "a" "a\nb"))
+           (dolist (input samples)
+             (insert input)
+             (ert-info ((format "Opts: %S, Input: %S, want: %S"
+                                (list wb sw) input (car ex)))
+               (setq messages "")
                (pcase-exhaustive (pop ex)
                  ('err (let ((e (should-error (erc-send-current-line))))
                          (should (string-match (rx (| "trailing" "blank"))
                  ('nop (erc-send-current-line)
                        (should (equal (erc-user-input) input))
                        (should-not (funcall next)))
-                 ('clr (erc-send-current-line)
-                       (should (string-empty-p (erc-user-input)))
-                       (should-not (funcall next)))
                  ((and (pred consp) v)
                   (erc-send-current-line)
                   (should (string-empty-p (erc-user-input)))
                       ('s (should (equal " \n" (car (funcall next)))))
                       ('a (should (equal "a\n" (car (funcall next)))))
                       ('b (should (equal "b\n" (car (funcall next)))))))
-                  (should-not (funcall next))))))
-           (delete-region erc-input-marker (point-max))))))))
+                  (should-not (funcall next)))))
+             (delete-region erc-input-marker (point-max)))))))))
 
 (ert-deftest erc--check-prompt-input-for-multiline-blanks/explanations ()
   (should erc-warn-about-blank-lines)