aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorF. Jason Park2024-07-10 15:36:38 -0700
committerF. Jason Park2024-07-10 15:50:26 -0700
commitef3f26ec02d49f00a14e8744ba06208773588c62 (patch)
tree8e0725a55071347d0758c7369f245ede0f1824cf /test
parent945335fec1e9349d05291c9abe0730777840f5b9 (diff)
downloademacs-ef3f26ec02d49f00a14e8744ba06208773588c62.tar.gz
emacs-ef3f26ec02d49f00a14e8744ba06208773588c62.zip
; Tag ERC multiline blanks test as :expensive
* 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)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/erc/erc-tests.el47
1 files changed, 23 insertions, 24 deletions
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index f4cff06f942..f65c1496087 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1635,25 +1635,27 @@
1635 '("Stripping" "Padding")) 1635 '("Stripping" "Padding"))
1636 1636
1637(ert-deftest erc--check-prompt-input-for-multiline-blanks () 1637(ert-deftest erc--check-prompt-input-for-multiline-blanks ()
1638 (erc-tests-common-with-process-input-spy 1638 :tags '(:expensive-test)
1639 (lambda (next) 1639 (ert-with-message-capture messages
1640 (erc-tests-common-init-server-proc "sleep" "10") 1640 (erc-tests-common-with-process-input-spy
1641 (should-not erc-send-whitespace-lines) 1641 (lambda (next)
1642 (should erc-warn-about-blank-lines) 1642 (erc-tests-common-init-server-proc "sleep" "300")
1643 1643 (should-not erc-send-whitespace-lines)
1644 (pcase-dolist (`((,wb ,sw) . ,ex) erc-tests--check-prompt-input--expect) 1644 (should erc-warn-about-blank-lines)
1645 (let ((print-escape-newlines t) 1645
1646 (erc-warn-about-blank-lines (eq wb '+wb)) 1646 (pcase-dolist (`((,wb ,sw) . ,ex) erc-tests--check-prompt-input--expect)
1647 (erc-send-whitespace-lines (eq sw '+sw)) 1647 (let ((print-escape-newlines t)
1648 (samples '("" " " "\n" "\n " " \n" "\n\n" 1648 (erc-warn-about-blank-lines (eq wb '+wb))
1649 "a\n" "a\n " "a\n \nb"))) 1649 (erc-send-whitespace-lines (eq sw '+sw))
1650 (setq ex `(,@ex (a) (a b)) ; baseline, same for all combos 1650 (samples '("" " " "\n" "\n " " \n" "\n\n"
1651 samples `(,@samples "a" "a\nb")) 1651 "a\n" "a\n " "a\n \nb")))
1652 (dolist (input samples) 1652 (setq ex `(,@ex (a) (a b)) ; baseline, same for all combos
1653 (insert input) 1653 samples `(,@samples "a" "a\nb"))
1654 (ert-info ((format "Opts: %S, Input: %S, want: %S" 1654 (dolist (input samples)
1655 (list wb sw) input (car ex))) 1655 (insert input)
1656 (ert-with-message-capture messages 1656 (ert-info ((format "Opts: %S, Input: %S, want: %S"
1657 (list wb sw) input (car ex)))
1658 (setq messages "")
1657 (pcase-exhaustive (pop ex) 1659 (pcase-exhaustive (pop ex)
1658 ('err (let ((e (should-error (erc-send-current-line)))) 1660 ('err (let ((e (should-error (erc-send-current-line))))
1659 (should (string-match (rx (| "trailing" "blank")) 1661 (should (string-match (rx (| "trailing" "blank"))
@@ -1663,9 +1665,6 @@
1663 ('nop (erc-send-current-line) 1665 ('nop (erc-send-current-line)
1664 (should (equal (erc-user-input) input)) 1666 (should (equal (erc-user-input) input))
1665 (should-not (funcall next))) 1667 (should-not (funcall next)))
1666 ('clr (erc-send-current-line)
1667 (should (string-empty-p (erc-user-input)))
1668 (should-not (funcall next)))
1669 ((and (pred consp) v) 1668 ((and (pred consp) v)
1670 (erc-send-current-line) 1669 (erc-send-current-line)
1671 (should (string-empty-p (erc-user-input))) 1670 (should (string-empty-p (erc-user-input)))
@@ -1679,8 +1678,8 @@
1679 ('s (should (equal " \n" (car (funcall next))))) 1678 ('s (should (equal " \n" (car (funcall next)))))
1680 ('a (should (equal "a\n" (car (funcall next))))) 1679 ('a (should (equal "a\n" (car (funcall next)))))
1681 ('b (should (equal "b\n" (car (funcall next))))))) 1680 ('b (should (equal "b\n" (car (funcall next)))))))
1682 (should-not (funcall next)))))) 1681 (should-not (funcall next)))))
1683 (delete-region erc-input-marker (point-max)))))))) 1682 (delete-region erc-input-marker (point-max)))))))))
1684 1683
1685(ert-deftest erc--check-prompt-input-for-multiline-blanks/explanations () 1684(ert-deftest erc--check-prompt-input-for-multiline-blanks/explanations ()
1686 (should erc-warn-about-blank-lines) 1685 (should erc-warn-about-blank-lines)