From 10aa53faea8b17ef659f166fdaf6da4191831aa1 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sun, 12 Sep 2021 19:25:41 -0700 Subject: [PATCH 0/1] *** SUBJECT HERE *** *** BLURB HERE *** F. Jason Park (1): Add CRLF to outgoing ERC protocol logger lines lisp/erc/erc.el | 77 ++++++++++++++++++++++++-------------- test/lisp/erc/erc-tests.el | 36 ++++++++++++++++++ 2 files changed, 85 insertions(+), 28 deletions(-) Interdiff: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 033c392502..524a22e5a1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2405,8 +2405,6 @@ erc-toggle-debug-irc-protocol (lambda () (setq erc-debug-irc-protocol nil)) nil 'local) (goto-char (point-max)) - ;; Searchable phrase printed twice between logs and once before - ;; the first. This is a single line with CRLF endings. (let ((inhibit-read-only t)) (insert (if erc-debug-irc-protocol "\r\n" "") (erc-make-notice diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index f94b52ec9f..7a0867a0a1 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -114,13 +114,11 @@ erc-ring-previous-command (ert-deftest erc-log-irc-protocol () (should-not erc-debug-irc-protocol) (with-temp-buffer - (let (erc-server-announced-name - erc-network - (erc-server-process (start-process "fake" (current-buffer) "true")) - (erc-server-current-nick "tester") - (erc-session-server "myproxy.localhost") - (erc-session-port 6667) - (inhibit-message t)) + (setq erc-server-process (start-process "fake" (current-buffer) "true") + erc-server-current-nick "tester" + erc-session-server "myproxy.localhost" + erc-session-port 6667) + (let ((inhibit-message noninteractive)) (erc-toggle-debug-irc-protocol) (erc-log-irc-protocol "PASS changeme\r\n" 'outgoing) (setq erc-server-announced-name "irc.gnu.org") @@ -130,18 +128,20 @@ erc-log-irc-protocol (erc-log-irc-protocol ":irc.gnu.org 422 tester :MOTD missing") (setq erc-network 'BarNet) (erc-log-irc-protocol ":irc.gnu.org 221 tester +i") - (delete-process erc-server-process))) + (set-process-query-on-exit-flag erc-server-process nil))) (with-current-buffer "*erc-protocol*" (goto-char (point-min)) - (search-forward "myproxy.localhost:6667 >> PASS") + (search-forward "Version") + (search-forward "\r\n\r\n") + (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position)) (forward-line) - (search-forward "irc.gnu.org << :irc.gnu.org 001") + (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position)) (forward-line) - (search-forward "irc.gnu.org << :irc.gnu.org 002") + (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position)) (forward-line) - (search-forward "FooNet << :irc.gnu.org 422") + (search-forward "FooNet << :irc.gnu.org 422" (line-end-position)) (forward-line) - (search-forward "BarNet << :irc.gnu.org 221")) + (search-forward "BarNet << :irc.gnu.org 221" (line-end-position))) (when noninteractive (kill-buffer "*erc-protocol*") (should-not erc-debug-irc-protocol))) -- 2.31.1