emacs-diffs
[Top][All Lists]
Advanced

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

master 4d60dcd87c: ; Fix inevitable failure in erc-dcc test


From: F. Jason Park
Subject: master 4d60dcd87c: ; Fix inevitable failure in erc-dcc test
Date: Tue, 24 May 2022 21:29:16 -0400 (EDT)

branch: master
commit 4d60dcd87c72f7b96cac04233ffb253bd79f5bb1
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>

    ; Fix inevitable failure in erc-dcc test
    
    * test/lisp/erc/erc-dcc-tests.el
    (erc-dcc-tests--dcc-handle-ctcp-send): Shadow hook to prevent the
    erc-button module from interfering with tests that use this helper.
---
 test/lisp/erc/erc-dcc-tests.el | 76 ++++++++++++++++++++++--------------------
 1 file changed, 39 insertions(+), 37 deletions(-)

diff --git a/test/lisp/erc/erc-dcc-tests.el b/test/lisp/erc/erc-dcc-tests.el
index a10cbfc02c..a1dfbab9dc 100644
--- a/test/lisp/erc/erc-dcc-tests.el
+++ b/test/lisp/erc/erc-dcc-tests.el
@@ -49,43 +49,45 @@
 ;; `erc-dcc-do-LIST-command'
 
 (defun erc-dcc-tests--dcc-handle-ctcp-send (turbo)
-  (with-current-buffer (get-buffer-create "fake-server")
-    (erc-mode)
-    (setq erc-server-process
-          (start-process "fake" (current-buffer) "sleep" "10")
-          erc-input-marker (make-marker)
-          erc-insert-marker (make-marker)
-          erc-server-current-nick "dummy")
-    (set-process-query-on-exit-flag erc-server-process nil)
-    (should-not erc-dcc-list)
-    (erc-ctcp-query-DCC erc-server-process
-                        "tester"
-                        "~tester"
-                        "fake.irc"
-                        "dummy"
-                        (concat "DCC " (if turbo "TSEND" "SEND")
-                                " foo 2130706433 9899 1405135128"))
-    (should-not (cdr erc-dcc-list))
-    (should (equal (plist-put (car erc-dcc-list) :parent 'fake)
-                   `(:nick "tester!~tester@fake.irc"
-                           :type GET
-                           :peer nil
-                           :parent fake
-                           :ip "127.0.0.1"
-                           :port "9899"
-                           :file "foo"
-                           :size 1405135128
-                           :turbo ,(and turbo t)
-                           :secure nil)))
-    (goto-char (point-min))
-    (should (search-forward "file foo offered by tester" nil t))
-    (erc-dcc-do-LIST-command erc-server-process)
-    (should (search-forward-regexp (concat
-                                    "GET +no +1405135128 +foo"
-                                    (and turbo " +(T)") "$")
-                                   nil t))
-    (when noninteractive
-      (let (erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook)
+  (let (erc-send-completed-hook
+        erc-insert-modify-hook
+        erc-kill-channel-hook erc-kill-server-hook erc-kill-buffer-hook)
+    (with-current-buffer (get-buffer-create "fake-server")
+      (erc-mode)
+      (setq erc-server-process
+            (start-process "fake" (current-buffer) "sleep" "10")
+            erc-input-marker (make-marker)
+            erc-insert-marker (make-marker)
+            erc-server-current-nick "dummy")
+      (set-process-query-on-exit-flag erc-server-process nil)
+      (should-not erc-dcc-list)
+      (erc-ctcp-query-DCC erc-server-process
+                          "tester"
+                          "~tester"
+                          "fake.irc"
+                          "dummy"
+                          (concat "DCC " (if turbo "TSEND" "SEND")
+                                  " foo 2130706433 9899 1405135128"))
+      (should-not (cdr erc-dcc-list))
+      (should (equal (plist-put (car erc-dcc-list) :parent 'fake)
+                     `(:nick "tester!~tester@fake.irc"
+                             :type GET
+                             :peer nil
+                             :parent fake
+                             :ip "127.0.0.1"
+                             :port "9899"
+                             :file "foo"
+                             :size 1405135128
+                             :turbo ,(and turbo t)
+                             :secure nil)))
+      (goto-char (point-min))
+      (should (search-forward "file foo offered by tester" nil t))
+      (erc-dcc-do-LIST-command erc-server-process)
+      (should (search-forward-regexp (concat
+                                      "GET +no +1405135128 +foo"
+                                      (and turbo " +(T)") "$")
+                                     nil t))
+      (when noninteractive
         (kill-buffer))))
   ;; `erc-dcc-list' is global; must leave it empty
   (should erc-dcc-list)



reply via email to

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