From 922ad238403d8d821bd696372ffe58572df12670 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Thu, 13 May 2021 05:55:22 -0700 Subject: Add user-oriented test scenarios for ERC * test/lisp/erc/erc-scenarios-base-association-nick.el: New file. * test/lisp/erc/erc-scenarios-base-association-samenet.el: New file. * test/lisp/erc/erc-scenarios-base-association.el: New file. * test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el: New file. * test/lisp/erc/erc-scenarios-base-misc-regressions.el: New file. * test/lisp/erc/erc-scenarios-base-netid-bouncer-id.el: New file. * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-base.el: New file. * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-both.el: New file. * test/lisp/erc/erc-scenarios-base-netid-bouncer-recon-id.el: New file. * test/lisp/erc/erc-scenarios-base-netid-bouncer.el: New file. * test/lisp/erc/erc-scenarios-base-netid-samenet.el: New file. * test/lisp/erc/erc-scenarios-base-reconnect.el: New file. * test/lisp/erc/erc-scenarios-base-renick.el: New file. * test/lisp/erc/erc-scenarios-base-reuse-buffers.el: New file. * test/lisp/erc/erc-scenarios-base-unstable.el: New file. * test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el: New file. * test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el: New file. * test/lisp/erc/erc-scenarios-misc.el: New file. * test/lisp/erc/erc-scenarios-services-misc.el: New file. * test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld: New file. * test/lisp/erc/resources/base/assoc/bouncer-history/foonet.eld: New file. * test/lisp/erc/resources/base/assoc/bumped/again.eld: New file. * test/lisp/erc/resources/base/assoc/bumped/foisted.eld: New file. * test/lisp/erc/resources/base/assoc/bumped/refoisted.eld: New file. * test/lisp/erc/resources/base/assoc/bumped/renicked.eld: New file. * test/lisp/erc/resources/base/assoc/multi-net/barnet.eld: New file. * test/lisp/erc/resources/base/assoc/multi-net/foonet.eld: New file. * test/lisp/erc/resources/base/assoc/reconplay/again.eld: New file. * test/lisp/erc/resources/base/assoc/reconplay/foonet.eld: New file. * test/lisp/erc/resources/base/assoc/samenet/chester.eld: New file. * test/lisp/erc/resources/base/assoc/samenet/tester.eld: New file. * test/lisp/erc/resources/base/assoc/samenet/tester2.eld: New file. * test/lisp/erc/resources/base/channel-buffer-revival/foonet.eld: New file. * test/lisp/erc/resources/base/flood/soju.eld: New file. * test/lisp/erc/resources/base/gapless-connect/barnet.eld: New file. * test/lisp/erc/resources/base/gapless-connect/foonet.eld: New file. * test/lisp/erc/resources/base/gapless-connect/pass-stub.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/barnet-drop.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/barnet.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/foonet-again.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/foonet.eld: New file. * test/lisp/erc/resources/base/netid/bouncer/stub-again.eld: New file. * test/lisp/erc/resources/base/netid/samenet/chester.eld: New file. * test/lisp/erc/resources/base/netid/samenet/tester.eld: New file. * test/lisp/erc/resources/base/reconnect/aborted-dupe.eld: New file. * test/lisp/erc/resources/base/reconnect/aborted.eld: New file. * test/lisp/erc/resources/base/reconnect/options-again.eld: New file. * test/lisp/erc/resources/base/reconnect/options.eld: New file. * test/lisp/erc/resources/base/reconnect/timer-last.eld: New file. * test/lisp/erc/resources/base/reconnect/timer.eld: New file. * test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld: New file. * test/lisp/erc/resources/base/renick/queries/bouncer-foonet.eld: New file. * test/lisp/erc/resources/base/renick/queries/solo.eld: New file. * test/lisp/erc/resources/base/renick/self/auto.eld: New file. * test/lisp/erc/resources/base/renick/self/manual.eld: New file. * test/lisp/erc/resources/base/renick/self/qual-chester.eld: New file. * test/lisp/erc/resources/base/renick/self/qual-tester.eld: New file. * test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld: New file. * test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld: New file. * test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld: New file. * test/lisp/erc/resources/base/upstream-reconnect/soju-foonet.eld: New file. * test/lisp/erc/resources/base/upstream-reconnect/znc-barnet.eld: New file. * test/lisp/erc/resources/base/upstream-reconnect/znc-foonet.eld: New file. * test/lisp/erc/resources/erc-scenarios-common.el: New file. * test/lisp/erc/resources/networks/announced-missing/foonet.eld: New file. * test/lisp/erc/resources/services/password/libera.eld: New file. Add test cases for locking down fundamental client behavior, much of it involving the relationship between buffers and connections. Also add accompanying resources subdir containing canned dialog scripts and common code needed by various tests. For test cases demoing the problematic behavior originally described in the initial report, see update #4 on the bug tracker thread for bug#48598. Most reside in a file named test/lisp/erc/erc-scenarios-48598.el introduced by the patch "Add user-oriented test scenarios for ERC". --- .../resources/base/reuse-buffers/server/barnet.eld | 24 ++++++++++++++++++++++ .../resources/base/reuse-buffers/server/foonet.eld | 24 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld create mode 100644 test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld (limited to 'test/lisp/erc/resources/base/reuse-buffers') diff --git a/test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld b/test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld new file mode 100644 index 00000000000..cc7aff10076 --- /dev/null +++ b/test/lisp/erc/resources/base/reuse-buffers/server/barnet.eld @@ -0,0 +1,24 @@ +;; -*- mode: lisp-data; -*- +((pass 1 "PASS :barnet:changeme")) +((nick 1 "NICK tester")) +((user 2 "USER user 0 * :tester") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Sun, 25 Apr 2021 11:28:28 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10.2 "MODE tester +i") + ;; No mode answer + (0 ":irc.znc.in 306 tester :You have been marked as being away") + (0 ":irc.barnet.org NOTICE tester :[11:29:00] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") + (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) diff --git a/test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld b/test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld new file mode 100644 index 00000000000..3a846108466 --- /dev/null +++ b/test/lisp/erc/resources/base/reuse-buffers/server/foonet.eld @@ -0,0 +1,24 @@ +;; -*- mode: lisp-data; -*- +((pass 1 "PASS :foonet:changeme")) +((nick 1 "NICK tester")) +((user 1 "USER user 0 * :tester") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Sun, 25 Apr 2021 11:28:28 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 10.2 "MODE tester +i") + ;; No mode answer + (0 ":irc.znc.in 306 tester :You have been marked as being away") + (0 ":irc.foonet.org NOTICE tester :[11:29:00] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") + (0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) -- cgit v1.2.3 From 05902243431c877011a0bf6ce38c9230d0ef0721 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 16 Aug 2021 04:38:18 -0700 Subject: Standardize auth-source queries in ERC * lisp/erc/erc.el (erc-password): Deprecate variable only used by `erc-select-read-args'. Server passwords are primarily used as surrogates for other forms of authentication. Such use is common but nonstandard and often discouraged in favor of the de facto standard, SASL. Folks in the habit of invoking `erc(-tls)' interactively should be encouraged to use auth-source instead. (erc-select-read-args): Before this change, `erc-select-read-args' offered to use the value of a non-nil `erc-password' as the :password argument for `erc' and `erc-tls', referring to it as the "default" password. And when `erc-prompt-for-password' was nil and `erc-password' wasn't, the latter was passed along unconditionally. This only further complicated an already confusing situation for new users, who in most cases shouldn't be worried about sending a PASS command at all. Until SASL arrives, they should provide server passwords manually or learn to use auth-source. (erc-auth-source-server-function, erc-auth-source-join-function): New user options for retrieving a password externally, ostensibly by calling `auth-source-search'. (erc--auth-source-determine-params-defaults): New helper for `erc--auth-source-search' with potential for exporting publicly in the future. Favors :host and :port fields above others. Prioritizes network IDs over announced servers and dialed endpoints. (erc--auth-source-determine-params-merge): Add new function for merging contextual and default parameters. This is another contender for possible exporting. (erc--auth-source-search): New function for consulting auth-source and sorting the result as filtered and prioritized by the previously mentioned helpers. (erc-auth-source-search): New function to serve as default value for auth-source query-function options. (erc-server-join-channel): Use user option for consulting auth-source facility. Also accept nil for first argument (instead of server). (erc-cmd-JOIN): Use above-mentioned facilities when joining new channel. Omit server when calling `erc-server-join-channel'. Don't filter target buffers twice. Don't call `switch-to-buffer', which would create phantom buffers with names like target/server that were never used. IOW, only switch to existing target buffers. (erc--compute-server-password): Add new helper function for determining password. (erc-open, erc-determine-parameters): Move password figuring from the first to the latter. * lisp/erc/erc-services.el (erc-auth-source-services-function): Add new option for consulting auth-source in a NickServ context. (erc-nickserv-get-password): Pass network-context ID, when looking up password in `erc-nickserv-passwords' and when formatting prompt for user input. (erc-nickserv-passwords): Add comment to custom option definition type tag. * test/lisp/erc/erc-services-tests.el: Add new test file for above changes. For now, stash auth-source-related tests here until a suitable home can be found. * lisp/erc/erc-join.el (erc-autojoin--join): Don't pass session-like entity from `erc-autojoin-channels-alist' match to `erc-server-join-channel'. Allow that function to decide for itself which host to look up if necessary. * test/lisp/erc/resources/base/auth-source/foonet.eld: New file. * test/lisp/erc/resources/base/auth-source/nopass.eld: New file. * test/lisp/erc/resources/erc-scenarios-common.el: New file. * test/lisp/erc/resources/services/auth-source/libera.eld: New file. * test/lisp/erc/erc-scenarios-auth-source.el: New file. * test/lisp/erc/erc-scenarios-base-reuse-buffers.el: New file. * test/lisp/erc/erc-scenarios-join-auth-source.el: New file. * test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld: New file. * test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld: New file. * test/lisp/erc/resources/join/auth-source/foonet.eld: New file. (Bug#48598) --- lisp/erc/erc-join.el | 2 +- lisp/erc/erc-services.el | 53 +- lisp/erc/erc.el | 198 +++++-- test/lisp/erc/erc-scenarios-auth-source.el | 178 +++++++ test/lisp/erc/erc-scenarios-base-reuse-buffers.el | 128 +++++ test/lisp/erc/erc-scenarios-join-auth-source.el | 67 +++ test/lisp/erc/erc-services-tests.el | 574 +++++++++++++++++++++ .../lisp/erc/resources/base/auth-source/foonet.eld | 23 + .../lisp/erc/resources/base/auth-source/nopass.eld | 22 + .../base/reuse-buffers/channel/barnet.eld | 68 +++ .../base/reuse-buffers/channel/foonet.eld | 66 +++ test/lisp/erc/resources/erc-scenarios-common.el | 1 + .../lisp/erc/resources/join/auth-source/foonet.eld | 33 ++ .../erc/resources/services/auth-source/libera.eld | 49 ++ 14 files changed, 1390 insertions(+), 72 deletions(-) create mode 100644 test/lisp/erc/erc-scenarios-auth-source.el create mode 100644 test/lisp/erc/erc-scenarios-join-auth-source.el create mode 100644 test/lisp/erc/erc-services-tests.el create mode 100644 test/lisp/erc/resources/base/auth-source/foonet.eld create mode 100644 test/lisp/erc/resources/base/auth-source/nopass.eld create mode 100644 test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld create mode 100644 test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld create mode 100644 test/lisp/erc/resources/join/auth-source/foonet.eld create mode 100644 test/lisp/erc/resources/services/auth-source/libera.eld (limited to 'test/lisp/erc/resources/base/reuse-buffers') diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index d4edca236d1..b4044548e84 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -145,7 +145,7 @@ network or a network ID). Return nil on failure." (let ((buf (erc-get-buffer chan erc-server-process))) (unless (and buf (with-current-buffer buf (erc--current-buffer-joined-p))) - (erc-server-join-channel match chan))))))) + (erc-server-join-channel nil chan))))))) (defun erc-autojoin-after-ident (_network _nick) "Autojoin channels in `erc-autojoin-channels-alist'. diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index cc5d5701e44..fe9cb5b5f17 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -174,6 +174,18 @@ function `erc-nickserv-get-password'." :version "28.1" :type 'boolean) +(defcustom erc-auth-source-services-function #'erc-auth-source-search + "Function to retrieve NickServ password from auth-source. +Called with a subset of keyword parameters known to +`auth-source-search' and relevant to authenticating to nickname +services. In return, ERC expects a string to send as the +password, or nil, to fall through to the next method, such as +prompting. See info node `(erc) Connecting' for details." + :package-version '(ERC . "5.4.1") ; FIXME update when publishing to ELPA + :type '(choice (const erc-auth-source-search) + (const nil) + function)) + (defcustom erc-nickserv-passwords nil "Passwords used when identifying to NickServ automatically. `erc-prompt-for-nickserv-password' must be nil for these @@ -202,7 +214,7 @@ Example of use: (const QuakeNet) (const Rizon) (const SlashNET) - (symbol :tag "Network name")) + (symbol :tag "Network name or session ID")) (repeat :tag "Nickname and password" (cons :tag "Identity" (string :tag "Nick") @@ -431,31 +443,20 @@ As soon as some source returns a password, the sequence of lookups stops and this function returns it (or returns nil if it is empty). Otherwise, no corresponding password was found, and it returns nil." - (let (network server port) - ;; Fill in local vars, switching to the server buffer once only - (erc-with-server-buffer - (setq network erc-network - server erc-session-server - port erc-session-port)) - (let ((ret - (or - (when erc-nickserv-passwords - (cdr (assoc nick - (cl-second (assoc network - erc-nickserv-passwords))))) - (when erc-use-auth-source-for-nickserv-password - (auth-source-pick-first-password - :require '(:secret) - :host server - ;; Ensure a string for :port - :port (format "%s" port) - :user nick)) - (when erc-prompt-for-nickserv-password - (read-passwd - (format "NickServ password for %s on %s (RET to cancel): " - nick network)))))) - (when (and ret (not (string= ret ""))) - ret)))) + (when-let* + ((nid (erc-networks--id-symbol erc-networks--id)) + (ret (or (when erc-nickserv-passwords + (assoc-default nick + (cadr (assq nid erc-nickserv-passwords)))) + (when (and erc-use-auth-source-for-nickserv-password + erc-auth-source-services-function) + (funcall erc-auth-source-services-function :user nick)) + (when erc-prompt-for-nickserv-password + (read-passwd + (format "NickServ password for %s on %s (RET to cancel): " + nick nid))))) + ((not (string-empty-p ret)))) + ret)) (defvar erc-auto-discard-away) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 4b24f953ddb..1c221a9cb13 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -228,9 +228,14 @@ parameters and authentication." "old behavior when t now permanent" "29.1") (defvar erc-password nil - "Password to use when authenticating to an IRC server. -It is not strictly necessary to provide this, since ERC will -prompt you for it.") + "Password to use when authenticating to an IRC server interactively. + +This variable only exists for legacy reasons. It's not customizable and +is limited to a single server password. Users looking for similar +functionality should consider auth-source instead. See info +node `(auth) Top' and info node `(erc) Connecting'.") + +(make-obsolete-variable 'erc-password "use auth-source instead" "29.1") (defcustom erc-user-mode "+i" ;; +i "Invisible". Hides user from global /who and /names. @@ -241,7 +246,7 @@ prompt you for it.") (defcustom erc-prompt-for-password t - "Asks before using the default password, or whether to enter a new one." + "Ask for a server password when invoking `erc-tls' interactively." :group 'erc :type 'boolean) @@ -2210,15 +2215,6 @@ Returns the buffer for the given server or channel." (setq erc-logged-in nil) ;; The local copy of `erc-nick' - the list of nicks to choose (setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick))) - ;; password stuff - (setq erc-session-password - (or passwd - (auth-source-pick-first-password - :host server - :user nick - ;; secrets.el wouldn’t accept a number - :port (if (numberp port) (number-to-string port) port) - :require '(:secret)))) ;; client certificate (only useful if connecting over TLS) (setq erc-session-client-certificate client-certificate) (setq erc-networks--id (if connect @@ -2240,7 +2236,7 @@ Returns the buffer for the given server or channel." (erc-display-prompt) (goto-char (point-max))) - (erc-determine-parameters server port nick full-name user) + (erc-determine-parameters server port nick full-name user passwd) ;; Saving log file on exit (run-hook-with-args 'erc-connect-pre-hook buffer) @@ -2338,11 +2334,9 @@ parameters SERVER and NICK." (setq server user-input) (setq passwd (if erc-prompt-for-password - (if (and erc-password - (y-or-n-p "Use the default password? ")) - erc-password - (read-passwd "Password: ")) - erc-password)) + (read-passwd "Server password: ") + (with-suppressed-warnings ((obsolete erc-password)) + erc-password))) (when (and passwd (string= "" passwd)) (setq passwd nil)) @@ -3355,18 +3349,131 @@ For a list of user commands (/join /part, ...): (defalias 'erc-cmd-H #'erc-cmd-HELP) (put 'erc-cmd-HELP 'process-not-needed t) +(defcustom erc-auth-source-server-function #'erc-auth-source-search + "Function to query auth-source for a server password. +Called with a subset of keyword parameters known to +`auth-source-search' and relevant to an opening \"PASS\" command, +if any. In return, ERC expects a string to send as the server +password, or nil, to skip the \"PASS\" command completely. An +explicit `:password' argument to entry-point commands `erc' and +`erc-tls' also inhibits lookup, as does setting this option to +nil. See info node `(erc) Connecting' for details." + :package-version '(ERC . "5.4.1") ; FIXME update when publishing to ELPA + :group 'erc + :type '(choice (const erc-auth-source-search) + (const nil) + function)) + +(defcustom erc-auth-source-join-function #'erc-auth-source-search + "Function to query auth-source on joining a channel. +Called with a subset of keyword arguments known to +`auth-source-search' and relevant to joining a password-protected +channel. In return, ERC expects a string to use as the channel +\"key\", or nil to just join the channel normally. Setting the +option itself to nil tells ERC to always forgo consulting +auth-source for channel keys. For more information, see info +node `(erc) Connecting'." + :package-version '(ERC . "5.4.1") ; FIXME update when publishing to ELPA + :group 'erc + :type '(choice (const erc-auth-source-search) + (const nil) + function)) + +(defun erc--auth-source-determine-params-defaults () + (let* ((net (and-let* ((esid (erc-networks--id-symbol erc-networks--id)) + ((symbol-name esid))))) + (localp (and erc--target (erc--target-channel-local-p erc--target))) + (hosts (if localp + (list erc-server-announced-name erc-session-server net) + (list net erc-server-announced-name erc-session-server))) + (ports (list (cl-typecase erc-session-port + (integer (number-to-string erc-session-port)) + (string (and (string= erc-session-port "irc") + erc-session-port)) ; or nil + (t erc-session-port)) + "irc"))) + (list (cons :host (delq nil hosts)) + (cons :port (delq nil ports)) + (cons :require '(:secret))))) + +(defun erc--auth-source-determine-params-merge (&rest plist) + "Return a plist of merged keyword args to pass to `auth-source-search'. +Combine items in PLIST with others derived from the current connection +context, but prioritize the former. For keys not present in PLIST, +favor a network ID over an announced server unless `erc--target' is a +local channel. And treat the dialed server address as a fallback for +the announced name in both cases." + (let ((defaults (erc--auth-source-determine-params-defaults))) + `(,@(cl-loop for (key value) on plist by #'cddr + for default = (assq key defaults) + do (when default (setq defaults (delq default defaults))) + append `(,key ,(delete-dups + `(,@(if (consp value) value (list value)) + ,@(cdr default))))) + ,@(cl-loop for (k . v) in defaults append (list k v))))) + +(defun erc--auth-source-search (&rest defaults) + "Ask auth-source for a secret and return it if found. +Use DEFAULTS as keyword arguments for querying auth-source and as a +guide for narrowing results. Return a string if found or nil otherwise. +The ordering of DEFAULTS influences how results are filtered, as does +the ordering of the members of any individual composite values. If +necessary, the former takes priority. For example, if DEFAULTS were to +contain + + :host (\"foo\" \"bar\") :port (\"123\" \"456\") + +the secret from an auth-source entry of host foo and port 456 would be +chosen over another of host bar and port 123. However, if DEFAULTS +looked like + + :port (\"123\" \"456\") :host (\"foo\" \"bar\") + +the opposite would be true. In both cases, two entries with the same +host but different ports would result in the one with port 123 getting +the nod. Much the same would happen for entries sharing only a port: +the one with host foo would win." + (when-let* + ((priority (map-keys defaults)) + (test (lambda (a b) + (catch 'done + (dolist (key priority) + (let* ((d (plist-get defaults key)) + (defval (if (listp d) d (list d))) + ;; featurep 'seq via auth-source > json > map + (p (seq-position defval (plist-get a key))) + (q (seq-position defval (plist-get b key)))) + (unless (eql p q) + (throw 'done (when p (or (not q) (< p q)))))))))) + (plist (copy-sequence defaults))) + (unless (plist-get plist :max) + (setq plist (plist-put plist :max 5000))) ; `auth-source-netrc-parse' + (unless (plist-get defaults :require) + (setq plist (plist-put plist :require '(:secret)))) + (when-let* ((sorted (sort (apply #'auth-source-search plist) test)) + (secret (plist-get (car sorted) :secret))) + (if (functionp secret) (funcall secret) secret)))) + +(defun erc-auth-source-search (&rest plist) + "Call `auth-source-search', possibly with keyword params in PLIST." + ;; These exist as separate helpers in case folks should find them + ;; useful. If that's you, please request that they be exported. + (apply #'erc--auth-source-search + (apply #'erc--auth-source-determine-params-merge plist))) + (defun erc-server-join-channel (server channel &optional secret) - (let ((password - (or secret - (auth-source-pick-first-password - :host server - :port "irc" - :user channel)))) - (erc-log (format "cmd: JOIN: %s" channel)) - (erc-server-send (concat "JOIN " channel - (if password - (concat " " password) - ""))))) + "Join CHANNEL, optionally with SECRET. +Without SECRET, consult auth-source, possibly passing SERVER as the +`:host' query parameter." + (unless (or secret (not erc-auth-source-join-function)) + (unless server + (when (and erc-server-announced-name + (erc--valid-local-channel-p channel)) + (setq server erc-server-announced-name))) + (setq secret (apply erc-auth-source-join-function + `(,@(and server (list :host server)) :user ,channel)))) + (erc-log (format "cmd: JOIN: %s" channel)) + (erc-server-send (concat "JOIN " channel (and secret (concat " " secret))))) (defun erc--valid-local-channel-p (channel) "Non-nil when channel is server-local on a network that allows them." @@ -3388,19 +3495,12 @@ were most recently invited. See also `invitation'." (setq chnl (erc-ensure-channel-name channel))) (when chnl ;; Prevent double joining of same channel on same server. - (let* ((joined-channels - (mapcar (lambda (chanbuf) - (with-current-buffer chanbuf (erc-default-target))) - (erc-channel-list erc-server-process))) - (server (with-current-buffer (process-buffer erc-server-process) - (or erc-session-server erc-server-announced-name))) - (chnl-name (car (erc-member-ignore-case chnl joined-channels)))) - (if chnl-name - (switch-to-buffer (if (get-buffer chnl-name) - chnl-name - (concat chnl-name "/" server))) - (setq erc--server-last-reconnect-count 0) - (erc-server-join-channel server chnl key))))) + (if-let* ((existing (erc-get-buffer chnl erc-server-process)) + ((with-current-buffer existing + (erc-get-channel-user (erc-current-nick))))) + (switch-to-buffer existing) + (setq erc--server-last-reconnect-count 0) + (erc-server-join-channel nil chnl key)))) t) (defalias 'erc-cmd-CHANNEL #'erc-cmd-JOIN) @@ -6356,7 +6456,7 @@ user input." ;; connection properties' heuristics -(defun erc-determine-parameters (&optional server port nick name user) +(defun erc-determine-parameters (&optional server port nick name user passwd) "Determine the connection and authentication parameters. Sets the buffer local variables: @@ -6365,12 +6465,14 @@ Sets the buffer local variables: - `erc-session-port' - `erc-session-user-full-name' - `erc-session-username' +- `erc-session-password' - `erc-server-current-nick'" (setq erc-session-connector erc-server-connect-function erc-session-server (erc-compute-server server) erc-session-port (or port erc-default-port) erc-session-user-full-name (erc-compute-full-name name) - erc-session-username (erc-compute-user user)) + erc-session-username (erc-compute-user user) + erc-session-password (erc--compute-server-password passwd nick)) (erc-set-current-nick (erc-compute-nick nick))) (defun erc-compute-server (&optional server) @@ -6407,6 +6509,12 @@ non-nil value is found. (getenv "IRCNICK") (user-login-name))) +(defun erc--compute-server-password (password nick) + "Maybe provide a PASSWORD argument for the IRC \"PASS\" command. +When `erc-auth-source-server-function' is non-nil, call it with NICK for +the user field and use whatever it returns as the server password." + (or password (and erc-auth-source-server-function + (funcall erc-auth-source-server-function :user nick)))) (defun erc-compute-full-name (&optional full-name) "Return user's full name. diff --git a/test/lisp/erc/erc-scenarios-auth-source.el b/test/lisp/erc/erc-scenarios-auth-source.el new file mode 100644 index 00000000000..3d399a18154 --- /dev/null +++ b/test/lisp/erc/erc-scenarios-auth-source.el @@ -0,0 +1,178 @@ +;;; erc-scenarios-auth-source.el --- auth-source scenarios -*- lexical-binding: t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. +;; +;; This file is part of GNU Emacs. +;; +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see +;; . + +;; Commentary: +;; +;; For practical reasons (mainly lack of imagination), this file +;; contains tests for both server-password and NickServ contexts. + +(require 'ert-x) +(eval-and-compile + (let ((load-path (cons (ert-resource-directory) load-path))) + (require 'erc-scenarios-common))) + +(eval-when-compile (require 'erc-join) + (require 'erc-services)) + +(defun erc-scenarios-common--auth-source (id dialog &rest rest) + (push "machine GNU.chat port %d user \"#chan\" password spam" rest) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "base/auth-source") + (dumb-server (erc-d-run "localhost" t dialog)) + (port (process-contact dumb-server :service)) + (ents `(,@(mapcar (lambda (fmt) (format fmt port)) rest) + "machine MyHost port irc password 123")) + (netrc-file (make-temp-file "auth-source-test" nil nil + (string-join ents "\n"))) + (auth-sources (list netrc-file)) + (auth-source-do-cache nil) + (erc-scenarios-common-extra-teardown (lambda () + (delete-file netrc-file)))) + + (ert-info ("Connect") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :full-name "tester" + :id id) + (should (string= (buffer-name) (if id + (symbol-name id) + (format "127.0.0.1:%d" port)))) + (erc-d-t-wait-for 5 (eq erc-network 'FooNet)))))) + +(ert-deftest erc-scenarios-base-auth-source-server--dialed () + :tags '(:expensive-test) + (erc-scenarios-common--auth-source + nil 'foonet + "machine GNU.chat port %d user tester password fake" + "machine FooNet port %d user tester password fake" + "machine 127.0.0.1 port %d user tester password changeme" + "machine 127.0.0.1 port %d user imposter password fake")) + +(ert-deftest erc-scenarios-base-auth-source-server--netid () + :tags '(:expensive-test) + (erc-scenarios-common--auth-source + 'MySession 'foonet + "machine MySession port %d user tester password changeme" + "machine 127.0.0.1 port %d user tester password fake" + "machine FooNet port %d user tester password fake")) + +(ert-deftest erc-scenarios-base-auth-source-server--netid-custom () + :tags '(:expensive-test) + (let ((erc-auth-source-server-function + (lambda (&rest _) (erc-auth-source-search :host "MyHost")))) + (erc-scenarios-common--auth-source + 'MySession 'foonet + "machine 127.0.0.1 port %d user tester password fake" + "machine MyHost port %d user tester password changeme" + "machine MySession port %d user tester password fake"))) + +(ert-deftest erc-scenarios-base-auth-source-server--nopass () + :tags '(:expensive-test) + (let (erc-auth-source-server-function) + (erc-scenarios-common--auth-source nil 'nopass))) + +(ert-deftest erc-scenarios-base-auth-source-server--nopass-netid () + :tags '(:expensive-test) + (let (erc-auth-source-server-function) + (erc-scenarios-common--auth-source 'MySession 'nopass))) + +;; Identify via auth source with no initial password + +(defun erc-scenarios-common--services-auth-source (&rest rest) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "services/auth-source") + (erc-server-flood-penalty 0.1) + (dumb-server (erc-d-run "localhost" t 'libera)) + (port (process-contact dumb-server :service)) + (ents `(,@(mapcar (lambda (fmt) (format fmt port)) rest) + "machine MyHost port irc password 123")) + (netrc-file (make-temp-file "auth-source-test" nil nil + (string-join ents "\n"))) + (auth-sources (list netrc-file)) + (auth-source-do-cache nil) + (erc-modules (cons 'services erc-modules)) + (erc-use-auth-source-for-nickserv-password t) ; do consult for NickServ + (expect (erc-d-t-make-expecter)) + (erc-scenarios-common-extra-teardown (lambda () + (delete-file netrc-file)))) + + (cl-letf (((symbol-function 'read-passwd) + (lambda (&rest _) (error "Unexpected read-passwd call")))) + (ert-info ("Connect without password") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :full-name "tester") + (should (string= (buffer-name) (format "127.0.0.1:%d" port))) + (erc-d-t-wait-for 8 (eq erc-network 'Libera.Chat)) + (funcall expect 3 "This nickname is registered.") + (funcall expect 3 "You are now identified") + (funcall expect 3 "Last login from") + (erc-cmd-QUIT "")))) + + (erc-services-mode -1) + + (should-not (memq 'services erc-modules)))) + +;; These tests are about authenticating to nick services + +(ert-deftest erc-scenarios-services-auth-source--network () + :tags '(:expensive-test) + ;; Skip consulting auth-source for the server password (PASS). + (let (erc-auth-source-server-function) + (erc-scenarios-common--services-auth-source + "machine 127.0.0.1 port %d user tester password spam" + "machine zirconium.libera.chat port %d user tester password fake" + "machine Libera.Chat port %d user tester password changeme"))) + +(ert-deftest erc-scenarios-services-auth-source--network-connect-lookup () + :tags '(:expensive-test) + ;; Do consult auth-source for the server password (and find nothing) + (erc-scenarios-common--services-auth-source + "machine zirconium.libera.chat port %d user tester password fake" + "machine Libera.Chat port %d user tester password changeme")) + +(ert-deftest erc-scenarios-services-auth-source--announced () + :tags '(:expensive-test) + (let (erc-auth-source-server-function) + (erc-scenarios-common--services-auth-source + "machine 127.0.0.1 port %d user tester password spam" + "machine zirconium.libera.chat port %d user tester password changeme"))) + +(ert-deftest erc-scenarios-services-auth-source--dialed () + :tags '(:expensive-test) + ;; Support legacy host -> domain name + ;; (likely most common in real configs) + (let (erc-auth-source-server-function) + (erc-scenarios-common--services-auth-source + "machine 127.0.0.1 port %d user tester password changeme"))) + +(ert-deftest erc-scenarios-services-auth-source--custom () + :tags '(:expensive-test) + (let (erc-auth-source-server-function + (erc-auth-source-services-function + (lambda (&rest _) (erc-auth-source-search :host "MyAccount")))) + (erc-scenarios-common--services-auth-source + "machine zirconium.libera.chat port %d user tester password spam" + "machine MyAccount port %d user tester password changeme" + "machine 127.0.0.1 port %d user tester password fake"))) + +;;; erc-scenarios-auth-source.el ends here diff --git a/test/lisp/erc/erc-scenarios-base-reuse-buffers.el b/test/lisp/erc/erc-scenarios-base-reuse-buffers.el index 2e3ed9969f6..5af9589b745 100644 --- a/test/lisp/erc/erc-scenarios-base-reuse-buffers.el +++ b/test/lisp/erc/erc-scenarios-base-reuse-buffers.el @@ -107,4 +107,132 @@ collisions involving bouncers in ERC. Run EXTRA." erc-reuse-buffers) (erc-scenarios-common--base-reuse-buffers-server-buffers nil)))) +;; This also asserts that `erc-cmd-JOIN' is no longer susceptible to a +;; regression introduced in 28.1 (ERC 5.4) that caused phantom target +;; buffers of the form target/server to be created via +;; `switch-to-buffer' ("phantom" because they would go unused"). This +;; would happen (in place of a JOIN being sent out) when a previously +;; used (parted) target buffer existed and `erc-reuse-buffers' was +;; nil. +;; +;; Note: All the `erc-get-channel-user' calls have to do with the fact +;; that `erc-default-target' relies on the ambiguously defined +;; `erc-default-recipients' (meaning it's overloaded in the sense of +;; being used both for retrieving a target name and checking if a +;; channel has been PARTed). While not ideal, `erc-get-channel-user' +;; can (also) be used to detect the latter. + +(defun erc-scenarios-common--base-reuse-buffers-channel-buffers (port) + "The option `erc-reuse-buffers' is still respected when nil. +Adapted from scenario clash-of-chans/uniquify described in Bug#48598: +28.0.50; buffer-naming collisions involving bouncers in ERC." + (let* ((expect (erc-d-t-make-expecter)) + (server-buffer-foo + (get-buffer (format "127.0.0.1:%d/127.0.0.1" port))) + (server-buffer-bar + (get-buffer (format "127.0.0.1:%d/127.0.0.1<2>" port))) + (chan-buffer-foo (get-buffer "#chan/127.0.0.1")) + (chan-buffer-bar (get-buffer "#chan/127.0.0.1<2>")) + (server-process-foo (with-current-buffer server-buffer-foo + erc-server-process)) + (server-process-bar (with-current-buffer server-buffer-bar + erc-server-process))) + + (ert-info ("Unique #chan buffers exist") + (let ((chan-bufs (erc-scenarios-common-buflist "#chan")) + (known (list chan-buffer-bar chan-buffer-foo))) + (should (memq (pop chan-bufs) known)) + (should (memq (pop chan-bufs) known)) + (should-not chan-bufs))) + + (ert-info ("#chan@foonet is exclusive and not contaminated") + (with-current-buffer chan-buffer-foo + (funcall expect 1 "") + (erc-d-t-absent-for 0.1 "") + (funcall expect 1 "strength to climb") + (should (eq erc-server-process server-process-foo)))) + + (ert-info ("#chan@barnet is exclusive and not contaminated") + (with-current-buffer chan-buffer-bar + (funcall expect 1 "") + (erc-d-t-absent-for 0.1 "") + (funcall expect 1 "the loudest noise") + (should (eq erc-server-process server-process-bar)))) + + (ert-info ("Part #chan@foonet") + (with-current-buffer chan-buffer-foo + (erc-d-t-search-for 1 "shake my sword") + (erc-cmd-PART "#chan") + (funcall expect 3 "You have left channel #chan") + (erc-cmd-JOIN "#chan"))) + + (ert-info ("Part #chan@barnet") + (with-current-buffer chan-buffer-bar + (funcall expect 10 "Arm it in rags") + (should (erc-get-channel-user (erc-current-nick))) + (erc-cmd-PART "#chan") + (funcall expect 3 "You have left channel #chan") + (should-not (erc-get-channel-user (erc-current-nick))) + (erc-cmd-JOIN "#chan"))) + + (erc-d-t-wait-for 3 "New unique target buffer for #chan@foonet created" + (get-buffer "#chan/127.0.0.1<3>")) + + (ert-info ("Activity continues in new, -suffixed #chan@foonet buffer") + (with-current-buffer chan-buffer-foo + (should-not (erc-get-channel-user (erc-current-nick)))) + (with-current-buffer "#chan/127.0.0.1<3>" + (should (erc-get-channel-user (erc-current-nick))) + (funcall expect 2 "You have joined channel #chan") + (funcall expect 2 "#chan was created on") + (funcall expect 2 "") + (should (eq erc-server-process server-process-foo)) + (erc-d-t-absent-for 0.2 ""))) + + (sit-for 3) + (erc-d-t-wait-for 5 "New unique target buffer for #chan@barnet created" + (get-buffer "#chan/127.0.0.1<4>")) + + (ert-info ("Activity continues in new, -suffixed #chan@barnet buffer") + (with-current-buffer chan-buffer-bar + (should-not (erc-get-channel-user (erc-current-nick)))) + (with-current-buffer "#chan/127.0.0.1<4>" + (funcall expect 2 "You have joined channel #chan") + (funcall expect 1 "Users on #chan: @mike joe tester") + (funcall expect 2 "") + (should (eq erc-server-process server-process-bar)) + (erc-d-t-absent-for 0.2 ""))) + + (ert-info ("Two new chans created for a total of four") + (let* ((bufs (erc-scenarios-common-buflist "#chan")) + (names (sort (mapcar #'buffer-name bufs) #'string<))) + (should + (equal names (mapcar (lambda (f) (concat "#chan/127.0.0.1" f)) + '("" "<2>" "<3>" "<4>")))))) + + (ert-info ("All output sent") + (with-current-buffer "#chan/127.0.0.1<3>" + (funcall expect 10 "most lively")) + (with-current-buffer "#chan/127.0.0.1<4>" + (funcall expect 10 "soul black"))) + + ;; TODO ensure the exact 's aren't reassigned during killing as + ;; they are when the option is on. + (ert-info ("Buffers are exempt from shortening") + (kill-buffer "#chan/127.0.0.1<4>") + (kill-buffer "#chan/127.0.0.1<3>") + (kill-buffer chan-buffer-bar) + (should-not (get-buffer "#chan")) + (should chan-buffer-foo)))) + +(ert-deftest erc-scenarios-base-reuse-buffers-channel-buffers--disabled () + :tags '(:expensive-test) + (with-suppressed-warnings ((obsolete erc-reuse-buffers)) + (should erc-reuse-buffers) + (let ((erc-scenarios-common-dialog "base/reuse-buffers/channel") + (erc-server-flood-penalty 0.1) + erc-reuse-buffers) + (erc-scenarios-common--base-reuse-buffers-server-buffers + #'erc-scenarios-common--base-reuse-buffers-channel-buffers)))) + ;;; erc-scenarios-base-reuse-buffers.el ends here diff --git a/test/lisp/erc/erc-scenarios-join-auth-source.el b/test/lisp/erc/erc-scenarios-join-auth-source.el new file mode 100644 index 00000000000..94336db07c5 --- /dev/null +++ b/test/lisp/erc/erc-scenarios-join-auth-source.el @@ -0,0 +1,67 @@ +;;; erc-scenarios-join-auth-source.el --- join-auth-source scenarios -*- lexical-binding: t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. +;; +;; This file is part of GNU Emacs. +;; +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see +;; . + +;;; Commentary: + +;; TODO add another test with autojoin and channel keys + +(require 'ert-x) +(eval-and-compile + (let ((load-path (cons (ert-resource-directory) load-path))) + (require 'erc-scenarios-common))) + +(ert-deftest erc-scenarios-join-auth-source--network () + :tags '(:expensive-test) + (should erc-auth-source-join-function) + (erc-scenarios-common-with-cleanup + ((entries + '("machine 127.0.0.1 port %d login \"#foo\" password spam" + "machine irc.foonet.org port %d login tester password fake" + "machine irc.foonet.org login \"#spam\" password secret" + "machine foonet port %d login dummy password fake" + "machine 127.0.0.1 port %d login dummy password changeme")) + (erc-scenarios-common-dialog "join/auth-source") + (erc-server-flood-penalty 0.1) + (dumb-server (erc-d-run "localhost" t 'foonet)) + (port (process-contact dumb-server :service)) + (ents (mapcar (lambda (fmt) (format fmt port)) entries)) + (netrc-file (make-temp-file "auth-source-test" nil nil + (string-join ents "\n"))) + (auth-sources (list netrc-file)) + (auth-source-do-cache nil) + (expect (erc-d-t-make-expecter)) + (erc-scenarios-common-extra-teardown (lambda () + (delete-file netrc-file)))) + + (ert-info ("Connect without password") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "dummy" + :full-name "dummy") + (should (string= (buffer-name) (format "127.0.0.1:%d" port))) + (erc-d-t-wait-for 8 (eq erc-network 'foonet)) + (funcall expect 10 "user modes") + (erc-scenarios-common-say "/JOIN #spam"))) + + (ert-info ("Join #spam") + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#spam")) + (funcall expect 10 "#spam was created on"))))) + +;;; erc-scenarios-join-auth-source.el ends here diff --git a/test/lisp/erc/erc-services-tests.el b/test/lisp/erc/erc-services-tests.el new file mode 100644 index 00000000000..8e2b8d29273 --- /dev/null +++ b/test/lisp/erc/erc-services-tests.el @@ -0,0 +1,574 @@ +;;; erc-services-tests.el --- Tests for erc-services. -*- lexical-binding:t -*- + +;; Copyright (C) 2020-2022 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published +;; by the Free Software Foundation, either version 3 of the License, +;; or (at your option) any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; TODO: move the auth-source tests somewhere else. They've been +;; stashed here for pragmatic reasons. + +;;; Code: + +(require 'ert-x) +(require 'erc-services) +(require 'erc-compat) +(require 'secrets) + +;;;; Core auth-source + +(ert-deftest erc--auth-source-determine-params-merge () + (let ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-session-port 6697) + (erc-network 'fake) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create 'GNU.chat))) + + (should (equal (erc--auth-source-determine-params-merge) + '(:host ("GNU.chat" "my.gnu.org" "irc.gnu.org") + :port ("6697" "irc") + :require (:secret)))) + + (should (equal (erc--auth-source-determine-params-merge :host "fake") + '(:host ("fake" "GNU.chat" "my.gnu.org" "irc.gnu.org") + :port ("6697" "irc") + :require (:secret)))) + + (should (equal (erc--auth-source-determine-params-merge + :host '("fake") :require :host) + '(:host ("fake" "GNU.chat" "my.gnu.org" "irc.gnu.org") + :require (:host :secret) + :port ("6697" "irc")))) + + (should (equal (erc--auth-source-determine-params-merge + :host '("fake" "GNU.chat") :port "1234" :x "x") + '(:host ("fake" "GNU.chat" "my.gnu.org" "irc.gnu.org") + :port ("1234" "6697" "irc") + :x ("x") + :require (:secret)))))) + +;; Some of the following may be related to bug#23438. + +(defun erc-services-tests--auth-source-standard (search) + + (ert-info ("Session wins") + (let ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-session-port 6697) + (erc-network 'fake) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create 'GNU.chat))) + (should (string= (funcall search :user "#chan") "foo")))) + + (ert-info ("Network wins") + (let* ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-session-port 6697) + (erc-network 'GNU.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil))) + (should (string= (funcall search :user "#chan") "foo")))) + + (ert-info ("Announced wins") + (let ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-session-port 6697) + erc-network + (erc-networks--id (erc-networks--id-create nil))) + (should (string= (funcall search :user "#chan") "baz"))))) + +(defun erc-services-tests--auth-source-announced (search) + (let* ((erc--isupport-params (make-hash-table)) + (erc-server-parameters '(("CHANTYPES" . "&#"))) + (erc--target (erc--target-from-string "&chan"))) + + (ert-info ("Announced prioritized") + + (ert-info ("Announced wins") + (let* ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-session-port 6697) + (erc-network 'GNU.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil))) + (should (string= (funcall search :user "#chan") "baz")))) + + (ert-info ("Peer next") + (let* ((erc-server-announced-name "irc.gnu.org") + (erc-session-port 6697) + (erc-network 'GNU.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil))) + (should (string= (funcall search :user "#chan") "bar")))) + + (ert-info ("Network used as fallback") + (let* ((erc-session-port 6697) + (erc-network 'GNU.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil))) + (should (string= (funcall search :user "#chan") "foo"))))))) + +(defun erc-services-tests--auth-source-overrides (search) + (let* ((erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-network 'GNU.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil)) + (erc-session-port 6667)) + + (ert-info ("Specificity and overrides") + + (ert-info ("More specific port") + (let ((erc-session-port 6697)) + (should (string= (funcall search :user "#chan") "spam")))) + + (ert-info ("More specific user (network loses)") + (should (string= (funcall search :user '("#fsf")) "42"))) + + (ert-info ("Actual override") + (should (string= (funcall search :port "6667") "sesame"))) + + (ert-info ("Overrides don't interfere with post-processing") + (should (string= (funcall search :host "MyHost") "123")))))) + +;; auth-source netrc backend + +(defvar erc-services-tests--auth-source-entries + '("machine irc.gnu.org port irc user \"#chan\" password bar" + "machine my.gnu.org port irc user \"#chan\" password baz" + "machine GNU.chat port irc user \"#chan\" password foo")) + +;; FIXME explain what this is for +(defun erc-services-tests--auth-source-shuffle (&rest extra) + (string-join `(,@(sort (append erc-services-tests--auth-source-entries extra) + (lambda (&rest _) (zerop (random 2)))) + "") + "\n")) + +(ert-deftest erc--auth-source-search--netrc-standard () + (ert-with-temp-file netrc-file + :prefix "erc--auth-source-search--standard" + :text (erc-services-tests--auth-source-shuffle) + + (let ((auth-sources (list netrc-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-standard #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--netrc-announced () + (ert-with-temp-file netrc-file + :prefix "erc--auth-source-search--announced" + :text (erc-services-tests--auth-source-shuffle) + + (let ((auth-sources (list netrc-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-announced #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--netrc-overrides () + (ert-with-temp-file netrc-file + :prefix "erc--auth-source-search--overrides" + :text (erc-services-tests--auth-source-shuffle + "machine GNU.chat port 6697 user \"#chan\" password spam" + "machine my.gnu.org port irc user \"#fsf\" password 42" + "machine irc.gnu.org port 6667 password sesame" + "machine MyHost port irc password 456" + "machine MyHost port 6667 password 123") + + (let ((auth-sources (list netrc-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-overrides #'erc-auth-source-search)))) + +;; auth-source plstore backend + +(defun erc-services-test--call-with-plstore (&rest args) + (advice-add 'epg-decrypt-string :override + (lambda (&rest r) (prin1-to-string (cadr r))) + '((name . erc--auth-source-plstore))) + (advice-add 'epg-find-configuration :override + (lambda (&rest _) "" '((program . "/bin/true"))) + '((name . erc--auth-source-plstore))) + (unwind-protect + (apply #'erc-auth-source-search args) + (advice-remove 'epg-decrypt-string 'erc--auth-source-plstore) + (advice-remove 'epg-find-configuration 'erc--auth-source-plstore))) + +(defvar erc-services-tests--auth-source-plstore-standard-entries + '(("ba950d38118a76d71f9f0591bb373d6cb366a512" + :secret-secret t + :host "irc.gnu.org" + :user "#chan" + :port "irc") + ("7f17ca445d11158065e911a6d0f4cbf52ca250e3" + :secret-secret t + :host "my.gnu.org" + :user "#chan" + :port "irc") + ("fcd3c8bd6daf4509de0ad6ee98e744ce0fca9377" + :secret-secret t + :host "GNU.chat" + :user "#chan" + :port "irc"))) + +(defvar erc-services-tests--auth-source-plstore-standard-secrets + '(("ba950d38118a76d71f9f0591bb373d6cb366a512" :secret "bar") + ("7f17ca445d11158065e911a6d0f4cbf52ca250e3" :secret "baz") + ("fcd3c8bd6daf4509de0ad6ee98e744ce0fca9377" :secret "foo"))) + +(ert-deftest erc--auth-source-search--plstore-standard () + (ert-with-temp-file plstore-file + :suffix ".plist" + :text (concat ";;; public entries -*- mode: plstore -*- \n" + (prin1-to-string + erc-services-tests--auth-source-plstore-standard-entries) + "\n;;; secret entries\n" + (prin1-to-string + erc-services-tests--auth-source-plstore-standard-secrets) + "\n") + + (let ((auth-sources (list plstore-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-standard + #'erc-services-test--call-with-plstore)))) + +(ert-deftest erc--auth-source-search--plstore-announced () + (ert-with-temp-file plstore-file + :suffix ".plist" + :text (concat ";;; public entries -*- mode: plstore -*- \n" + (prin1-to-string + erc-services-tests--auth-source-plstore-standard-entries) + "\n;;; secret entries\n" + (prin1-to-string + erc-services-tests--auth-source-plstore-standard-secrets) + "\n") + + (let ((auth-sources (list plstore-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-announced + #'erc-services-test--call-with-plstore)))) + +(ert-deftest erc--auth-source-search--plstore-overrides () + (ert-with-temp-file plstore-file + :suffix ".plist" + :text (concat + ";;; public entries -*- mode: plstore -*- \n" + (prin1-to-string + `(,@erc-services-tests--auth-source-plstore-standard-entries + ("1b3fab249a8dff77a4d8fe7eb4b0171b25cc711a" + :secret-secret t :host "GNU.chat" :user "#chan" :port "6697") + ("6cbcdc39476b8cfcca6f3e9a7876f41ec3f708cc" + :secret-secret t :host "my.gnu.org" :user "#fsf" :port "irc") + ("a33e2b3bd2d6f33995a4b88710a594a100c5e41d" + :secret-secret t :host "irc.gnu.org" :port "6667") + ("ab2fd349b2b7d6a9215bb35a92d054261b0b1537" + :secret-secret t :host "MyHost" :port "irc") + ("61a6bd552059494f479ff720e8de33e22574650a" + :secret-secret t :host "MyHost" :port "6667"))) + "\n;;; secret entries\n" + (prin1-to-string + `(,@erc-services-tests--auth-source-plstore-standard-secrets + ("1b3fab249a8dff77a4d8fe7eb4b0171b25cc711a" :secret "spam") + ("6cbcdc39476b8cfcca6f3e9a7876f41ec3f708cc" :secret "42") + ("a33e2b3bd2d6f33995a4b88710a594a100c5e41d" :secret "sesame") + ("ab2fd349b2b7d6a9215bb35a92d054261b0b1537" :secret "456") + ("61a6bd552059494f479ff720e8de33e22574650a" :secret "123"))) + "\n") + + (let ((auth-sources (list plstore-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-overrides + #'erc-services-test--call-with-plstore)))) + +;; auth-source JSON backend + +(defvar erc-services-tests--auth-source-json-standard-entries + [(:host "irc.gnu.org" :port "irc" :user "#chan" :secret "bar") + (:host "my.gnu.org" :port "irc" :user "#chan" :secret "baz") + (:host "GNU.chat" :port "irc" :user "#chan" :secret "foo")]) + +(ert-deftest erc--auth-source-search--json-standard () + (ert-with-temp-file json-store + :suffix ".json" + :text (let ((json-object-type 'plist)) + (json-encode + erc-services-tests--auth-source-json-standard-entries)) + (let ((auth-sources (list json-store)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-standard #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--json-announced () + (ert-with-temp-file plstore-file + :suffix ".json" + :text (let ((json-object-type 'plist)) + (json-encode + erc-services-tests--auth-source-json-standard-entries)) + + (let ((auth-sources (list plstore-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-announced #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--json-overrides () + (ert-with-temp-file json-file + :suffix ".json" + :text (let ((json-object-type 'plist)) + (json-encode + (vconcat + erc-services-tests--auth-source-json-standard-entries + [(:secret "spam" :host "GNU.chat" :user "#chan" :port "6697") + (:secret "42" :host "my.gnu.org" :user "#fsf" :port "irc") + (:secret "sesame" :host "irc.gnu.org" :port "6667") + (:secret "456" :host "MyHost" :port "irc") + (:secret "123" :host "MyHost" :port "6667")]))) + + (let ((auth-sources (list json-file)) + (auth-source-do-cache nil)) + (erc-services-tests--auth-source-overrides #'erc-auth-source-search)))) + +;; auth-source-secrets backend + +(defvar erc-services-tests--auth-source-secrets-standard-entries + '(("#chan@irc.gnu.org:irc" ; label + (:host . "irc.gnu.org") + (:user . "#chan") + (:port . "irc") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("#chan@my.gnu.org:irc" + (:host . "my.gnu.org") + (:user . "#chan") + (:port . "irc") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("#chan@GNU.chat:irc" + (:host . "GNU.chat") + (:user . "#chan") + (:port . "irc") + (:xdg:schema . "org.freedesktop.Secret.Generic")))) + +(defvar erc-services-tests--auth-source-secrets-standard-secrets + '(("#chan@irc.gnu.org:irc" . "bar") + ("#chan@my.gnu.org:irc" . "baz") + ("#chan@GNU.chat:irc" . "foo"))) + +(ert-deftest erc--auth-source-search--secrets-standard () + (skip-unless (bound-and-true-p secrets-enabled)) + (let ((auth-sources '("secrets:Test")) + (auth-source-do-cache nil) + (entries erc-services-tests--auth-source-secrets-standard-entries) + (secrets erc-services-tests--auth-source-secrets-standard-secrets)) + + (cl-letf (((symbol-function 'secrets-search-items) + (lambda (col &rest r) + (should (equal col "Test")) + (should (plist-get r :user)) + (map-keys entries))) + ((symbol-function 'secrets-get-secret) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label secrets))) + ((symbol-function 'secrets-get-attributes) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label entries)))) + + (erc-services-tests--auth-source-standard #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--secrets-announced () + (skip-unless (bound-and-true-p secrets-enabled)) + (let ((auth-sources '("secrets:Test")) + (auth-source-do-cache nil) + (entries erc-services-tests--auth-source-secrets-standard-entries) + (secrets erc-services-tests--auth-source-secrets-standard-secrets)) + + (cl-letf (((symbol-function 'secrets-search-items) + (lambda (col &rest r) + (should (equal col "Test")) + (should (plist-get r :user)) + (map-keys entries))) + ((symbol-function 'secrets-get-secret) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label secrets))) + ((symbol-function 'secrets-get-attributes) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label entries)))) + + (erc-services-tests--auth-source-announced #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--secrets-overrides () + (skip-unless (bound-and-true-p secrets-enabled)) + (let ((auth-sources '("secrets:Test")) + (auth-source-do-cache nil) + (entries `(,@erc-services-tests--auth-source-secrets-standard-entries + ("#chan@GNU.chat:6697" + (:host . "GNU.chat") (:user . "#chan") (:port . "6697") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("#fsf@my.gnu.org:irc" + (:host . "my.gnu.org") (:user . "#fsf") (:port . "irc") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("irc.gnu.org:6667" + (:host . "irc.gnu.org") (:port . "6667") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("MyHost:irc" + (:host . "MyHost") (:port . "irc") + (:xdg:schema . "org.freedesktop.Secret.Generic")) + ("MyHost:6667" + (:host . "MyHost") (:port . "6667") + (:xdg:schema . "org.freedesktop.Secret.Generic")))) + (secrets `(,@erc-services-tests--auth-source-secrets-standard-secrets + ("#chan@GNU.chat:6697" . "spam") + ("#fsf@my.gnu.org:irc" . "42" ) + ("irc.gnu.org:6667" . "sesame") + ("MyHost:irc" . "456") + ("MyHost:6667" . "123")))) + + (cl-letf (((symbol-function 'secrets-search-items) + (lambda (col &rest _) + (should (equal col "Test")) + (map-keys entries))) + ((symbol-function 'secrets-get-secret) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label secrets))) + ((symbol-function 'secrets-get-attributes) + (lambda (col label) + (should (equal col "Test")) + (assoc-default label entries)))) + + (erc-services-tests--auth-source-overrides #'erc-auth-source-search)))) + +;; auth-source-pass backend + +(require 'auth-source-pass) + +;; `auth-source-pass--find-match-unambiguous' returns something like: +;; +;; (list :host "irc.gnu.org" +;; :port "6697" +;; :user "rms" +;; :secret +;; #[0 "\301\302\300\"\207" +;; [((secret . "freedom")) auth-source-pass--get-attr secret] 3]) +;; +;; This function gives ^ (faked here to avoid gpg and file IO). See +;; `auth-source-pass--with-store' in ../auth-source-pass-tests.el +(defun erc-services-tests--asp-parse-entry (store entry) + (when-let ((found (cl-find entry store :key #'car :test #'string=))) + (list (assoc 'secret (cdr found))))) + +(defvar erc-join-tests--auth-source-pass-entries + '(("irc.gnu.org:irc/#chan" + ("port" . "irc") ("user" . "#chan") (secret . "bar")) + ("my.gnu.org:irc/#chan" + ("port" . "irc") ("user" . "#chan") (secret . "baz")) + ("GNU.chat:irc/#chan" + ("port" . "irc") ("user" . "#chan") (secret . "foo")))) + +(ert-deftest erc--auth-source-search--pass-standard () + (ert-skip "Pass backend not yet supported") + (let ((store erc-join-tests--auth-source-pass-entries) + (auth-sources '(password-store)) + (auth-source-do-cache nil)) + + (cl-letf (((symbol-function 'auth-source-pass-parse-entry) + (apply-partially #'erc-services-tests--asp-parse-entry store)) + ((symbol-function 'auth-source-pass-entries) + (lambda () (mapcar #'car store)))) + + (erc-services-tests--auth-source-standard #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--pass-announced () + (ert-skip "Pass backend not yet supported") + (let ((store erc-join-tests--auth-source-pass-entries) + (auth-sources '(password-store)) + (auth-source-do-cache nil)) + + (cl-letf (((symbol-function 'auth-source-pass-parse-entry) + (apply-partially #'erc-services-tests--asp-parse-entry store)) + ((symbol-function 'auth-source-pass-entries) + (lambda () (mapcar #'car store)))) + + (erc-services-tests--auth-source-announced #'erc-auth-source-search)))) + +(ert-deftest erc--auth-source-search--pass-overrides () + (ert-skip "Pass backend not yet supported") + (let ((store + `(,@erc-join-tests--auth-source-pass-entries + ("GNU.chat:6697/#chan" + ("port" . "6697") ("user" . "#chan") (secret . "spam")) + ("my.gnu.org:irc/#fsf" + ("port" . "irc") ("user" . "#fsf") (secret . "42")) + ("irc.gnu.org:6667" + ("port" . "6667") (secret . "sesame")) + ("MyHost:irc" + ("port" . "irc") (secret . "456")) + ("MyHost:6667" + ("port" . "6667") (secret . "123")))) + (auth-sources '(password-store)) + (auth-source-do-cache nil)) + + (cl-letf (((symbol-function 'auth-source-pass-parse-entry) + (apply-partially #'erc-services-tests--asp-parse-entry store)) + ((symbol-function 'auth-source-pass-entries) + (lambda () (mapcar #'car store)))) + + (erc-services-tests--auth-source-overrides #'erc-auth-source-search)))) + +;;;; The services module + +(ert-deftest erc-nickserv-get-password () + (should erc-prompt-for-nickserv-password) + (ert-with-temp-file netrc-file + :prefix "erc-nickserv-get-password" + :text (mapconcat 'identity + '("machine GNU/chat port 6697 user bob password spam" + "machine FSF.chat port 6697 user bob password sesame" + "machine MyHost port irc password 123") + "\n") + + (let* ((auth-sources (list netrc-file)) + (auth-source-do-cache nil) + (erc-nickserv-passwords '((FSF.chat (("alice" . "foo") + ("joe" . "bar"))))) + (erc-use-auth-source-for-nickserv-password t) + (erc-session-server "irc.gnu.org") + (erc-server-announced-name "my.gnu.org") + (erc-network 'FSF.chat) + (erc-server-current-nick "tester") + (erc-networks--id (erc-networks--id-create nil)) + (erc-session-port 6697)) + + (ert-info ("Lookup custom option") + (should (string= (erc-nickserv-get-password "alice") "foo"))) + + (ert-info ("Auth source") + (ert-info ("Network") + (should (string= (erc-nickserv-get-password "bob") "sesame"))) + + (ert-info ("Network ID") + (let ((erc-networks--id (erc-networks--id-create 'GNU/chat))) + (should (string= (erc-nickserv-get-password "bob") "spam"))))) + + (ert-info ("Read input") + (should (string= + (ert-simulate-keys "baz\r" (erc-nickserv-get-password "mike")) + "baz"))) + + (ert-info ("Failed") + (should-not (ert-simulate-keys "\r" + (erc-nickserv-get-password "fake"))))))) + + +;;; erc-services-tests.el ends here diff --git a/test/lisp/erc/resources/base/auth-source/foonet.eld b/test/lisp/erc/resources/base/auth-source/foonet.eld new file mode 100644 index 00000000000..1fe772c7e23 --- /dev/null +++ b/test/lisp/erc/resources/base/auth-source/foonet.eld @@ -0,0 +1,23 @@ +;; -*- mode: lisp-data; -*- +((pass 1 "PASS :changeme")) +((nick 1 "NICK tester")) +((user 1 "USER user 0 * :tester") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=FooNet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 1.2 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) diff --git a/test/lisp/erc/resources/base/auth-source/nopass.eld b/test/lisp/erc/resources/base/auth-source/nopass.eld new file mode 100644 index 00000000000..3fdb4ecf7bc --- /dev/null +++ b/test/lisp/erc/resources/base/auth-source/nopass.eld @@ -0,0 +1,22 @@ +;; -*- mode: lisp-data; -*- +((nick 1 "NICK tester")) +((user 1 "USER user 0 * :tester") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Tue, 04 May 2021 05:06:18 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=FooNet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 253 tester 0 :unregistered connections") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 1.2 "MODE tester +i") + (0 ":irc.foonet.org 221 tester +i") + (0 ":irc.foonet.org NOTICE tester :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.")) diff --git a/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld new file mode 100644 index 00000000000..82700c5912c --- /dev/null +++ b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld @@ -0,0 +1,68 @@ +;; -*- mode: lisp-data; -*- +((pass 3 "PASS :barnet:changeme")) +((nick 3 "NICK tester")) +((user 3 "USER user 0 * :tester") + (0 ":irc.barnet.org 001 tester :Welcome to the barnet IRC Network tester") + (0 ":irc.barnet.org 002 tester :Your host is irc.barnet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.barnet.org 003 tester :This server was created Wed, 05 May 2021 09:05:33 UTC") + (0 ":irc.barnet.org 004 tester irc.barnet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.barnet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.barnet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=barnet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.barnet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.barnet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.barnet.org 252 tester 0 :IRC Operators online") + (0 ":irc.barnet.org 254 tester 1 :channels formed") + (0 ":irc.barnet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.barnet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.barnet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.barnet.org 422 tester :MOTD File is missing")) + +((mode-user 10.2 "MODE tester +i") + ;; No mode answer + (0 ":irc.znc.in 306 tester :You have been marked as being away") + (0 ":tester!~u@wvys46tx8tpmk.irc JOIN #chan") + (0 ":irc.barnet.org 353 tester = #chan :joe @mike tester") + (0 ":irc.barnet.org 366 tester #chan :End of /NAMES list.") + (0 ":***!znc@znc.in PRIVMSG #chan :Buffer Playback...") + (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:16] joe: Tush! none but minstrels like of sonneting.") + (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:19] mike: Prithee, nuncle, be contented; 'tis a naughty night to swim in. Now a little fire in a wide field were like an old lecher's heart; a small spark, all the rest on's body cold. Look! here comes a walking fire.") + (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:22] joe: My name is Edgar, and thy father's son.") + (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:26] mike: Good my lord, be good to me; your honour is accounted a merciful man; good my lord.") + (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:31] joe: Thy child shall live, and I will see it nourish'd.") + (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:33] mike: Quick, quick; fear nothing; I'll be at thy elbow.") + (0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.") + (0 ":irc.barnet.org NOTICE tester :[09:05:35] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") + (0 ":irc.barnet.org 305 tester :You are no longer marked as being away")) + +((mode 3 "MODE #chan") + (0 ":irc.barnet.org 324 tester #chan +nt") + (0 ":irc.barnet.org 329 tester #chan 1620205534") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: That will be given to the loudest noise we make.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If it please your honour, I am the poor duke's constable, and my name is Elbow: I do lean upon justice, sir; and do bring in here before your good honour two notorious benefactors.") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Following the signs, woo'd but the sign of she.") + (0.5 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: That, sir, which I will not report after her.") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Boyet, prepare: I will away to-night.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If the man be a bachelor, sir, I can; but if he be a married man, he is his wife's head, and I can never cut off a woman's head.") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Thyself upon thy virtues, they on thee.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: Arm it in rags, a pigmy's straw doth pierce it.")) + +((part 5.1 "PART #chan :" quit) + (0 ":tester!~u@wvys46tx8tpmk.irc PART #chan :" quit)) + +((join 10.1 "JOIN #chan") + (0 ":tester!~u@wvys46tx8tpmk.irc JOIN #chan") + (0 ":irc.barnet.org 353 tester = #chan :@mike joe tester") + (0 ":irc.barnet.org 366 tester #chan :End of NAMES list") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :tester, welcome!") + (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :tester, welcome!")) + +((mode 1 "MODE #chan") + (0 ":irc.barnet.org 324 tester #chan +nt") + (0 ":irc.barnet.org 329 tester #chan 1620205534") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Chi non te vede, non te pretia.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: Well, if ever thou dost fall from this faith, thou wilt prove a notable argument.") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Of heavenly oaths, vow'd with integrity.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: These herblets shall, which we upon you strew.") + (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Aaron will have his soul black like his face.")) + +((linger 0.5 LINGER)) diff --git a/test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld b/test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld new file mode 100644 index 00000000000..a11cfac2e73 --- /dev/null +++ b/test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld @@ -0,0 +1,66 @@ +;; -*- mode: lisp-data; -*- +((pass 1 "PASS :foonet:changeme")) +((nick 1 "NICK tester")) +((user 1 "USER user 0 * :tester") + (0 ":irc.foonet.org 001 tester :Welcome to the foonet IRC Network tester") + (0 ":irc.foonet.org 002 tester :Your host is irc.foonet.org, running version oragono-2.6.0-7481bf0385b95b16") + (0 ":irc.foonet.org 003 tester :This server was created Wed, 05 May 2021 09:05:34 UTC") + (0 ":irc.foonet.org 004 tester irc.foonet.org oragono-2.6.0-7481bf0385b95b16 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0 ":irc.foonet.org 005 tester AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0 ":irc.foonet.org 005 tester MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0 ":irc.foonet.org 005 tester draft/CHATHISTORY=100 :are supported by this server") + (0 ":irc.foonet.org 251 tester :There are 0 users and 3 invisible on 1 server(s)") + (0 ":irc.foonet.org 252 tester 0 :IRC Operators online") + (0 ":irc.foonet.org 254 tester 1 :channels formed") + (0 ":irc.foonet.org 255 tester :I have 3 clients and 0 servers") + (0 ":irc.foonet.org 265 tester 3 3 :Current local users 3, max 3") + (0 ":irc.foonet.org 266 tester 3 3 :Current global users 3, max 3") + (0 ":irc.foonet.org 422 tester :MOTD File is missing")) + +((mode-user 12 "MODE tester +i") + ;; No mode answer + (0 ":irc.znc.in 306 tester :You have been marked as being away") + (0 ":tester!~u@247eaxkrufj44.irc JOIN #chan") + (0 ":irc.foonet.org 353 tester = #chan :alice @bob tester") + (0 ":irc.foonet.org 366 tester #chan :End of /NAMES list.") + (0 ":***!znc@znc.in PRIVMSG #chan :Buffer Playback...") + (0 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:07:19] bob: Is this; she hath bought the name of whore thus dearly.") + (0 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:07:24] alice: He sent to me, sir,Here he comes.") + (0 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:07:26] bob: Till I torment thee for this injury.") + (0 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:07:29] alice: There's an Italian come; and 'tis thought, one of Leonatus' friends.") + (0 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:09:33] bob: Ay, and the particular confirmations, point from point, to the full arming of the verity.") + (0 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :[09:09:35] alice: Kneel in the streets and beg for grace in vain.") + (0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.") + (0 ":irc.foonet.org NOTICE tester :[09:06:05] This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") + (0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) + +((mode 10 "MODE #chan") + (0 ":irc.foonet.org 324 tester #chan +nt") + (0 ":irc.foonet.org 329 tester #chan 1620205534") + (0.5 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: Nor I no strength to climb without thy help.") + (0.1 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :bob: Nothing, but let him have thanks. Demand of him my condition, and what credit I have with the duke.") + (0.1 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: Show me this piece. I am joyful of your sights.") + (0.2 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :bob: Whilst I can shake my sword or hear the drum.")) + +((part 5 "PART #chan :" quit) + (0 ":tester!~u@247eaxkrufj44.irc PART #chan :" quit)) + +((join 10 "JOIN #chan") + (0 ":tester!~u@247eaxkrufj44.irc JOIN #chan") + (0 ":irc.foonet.org 353 tester = #chan :@bob alice tester") + (0 ":irc.foonet.org 366 tester #chan :End of NAMES list") + (0.1 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :tester, welcome!") + (0 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :tester, welcome!")) + +((mode 1 "MODE #chan") + (0 ":irc.foonet.org 324 tester #chan +nt") + (0 ":irc.foonet.org 329 tester #chan 1620205534") + (0.1 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: Thou desirest me to stop in my tale against the hair.") + (0.1 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :bob: And dar'st not stand, nor look me in the face.") + (0.1 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: It should not be, by the persuasion of his new feasting.") + (0.1 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :bob: It was not given me, nor I did not buy it.") + (0.1 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: He that would vouch it in any place but here.") + (0.1 ":alice!~u@yppdd5tt4admc.irc PRIVMSG #chan :bob: In everything I wait upon his will.") + (0.1 ":bob!~u@yppdd5tt4admc.irc PRIVMSG #chan :alice: Thou counterfeit'st most lively.")) + +((linger 8 LINGER)) diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index 4c57624c33e..cbabfcd26be 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el @@ -122,6 +122,7 @@ (erc-modules (copy-sequence erc-modules)) (inhibit-interaction t) (auth-source-do-cache nil) + (erc-auth-source-parameters-join-function nil) (erc-autojoin-channels-alist nil) (erc-server-auto-reconnect nil) (erc-d-linger-secs 10) diff --git a/test/lisp/erc/resources/join/auth-source/foonet.eld b/test/lisp/erc/resources/join/auth-source/foonet.eld new file mode 100644 index 00000000000..32b9e3fa0b6 --- /dev/null +++ b/test/lisp/erc/resources/join/auth-source/foonet.eld @@ -0,0 +1,33 @@ +;; -*- mode: lisp-data; -*- +((pass 1 "PASS :changeme")) +((nick 1 "NICK dummy")) +((user 1 "USER user 0 * :dummy") + (0.00 ":irc.foonet.org 001 dummy :Welcome to the foonet IRC Network dummy") + (0.01 ":irc.foonet.org 002 dummy :Your host is irc.foonet.org, running version ergo-v2.8.0") + (0.00 ":irc.foonet.org 003 dummy :This server was created Tue, 24 May 2022 05:28:42 UTC") + (0.00 ":irc.foonet.org 004 dummy irc.foonet.org ergo-v2.8.0 BERTZios CEIMRUabefhiklmnoqstuv Iabefhkloqv") + (0.00 ":irc.foonet.org 005 dummy AWAYLEN=390 BOT=B CASEMAPPING=ascii CHANLIMIT=#:100 CHANMODES=Ibe,k,fl,CEMRUimnstu CHANNELLEN=64 CHANTYPES=# ELIST=U EXCEPTS EXTBAN=,m FORWARD=f INVEX KICKLEN=390 :are supported by this server") + (0.01 ":irc.foonet.org 005 dummy MAXLIST=beI:60 MAXTARGETS=4 MODES MONITOR=100 NETWORK=foonet NICKLEN=32 PREFIX=(qaohv)~&@%+ STATUSMSG=~&@%+ TARGMAX=NAMES:1,LIST:1,KICK:,WHOIS:1,USERHOST:10,PRIVMSG:4,TAGMSG:4,NOTICE:4,MONITOR:100 TOPICLEN=390 UTF8MAPPING=rfc8265 UTF8ONLY WHOX :are supported by this server") + (0.01 ":irc.foonet.org 005 dummy draft/CHATHISTORY=100 :are supported by this server") + (0.00 ":irc.foonet.org 251 dummy :There are 0 users and 4 invisible on 1 server(s)") + (0.00 ":irc.foonet.org 252 dummy 0 :IRC Operators online") + (0.00 ":irc.foonet.org 253 dummy 0 :unregistered connections") + (0.00 ":irc.foonet.org 254 dummy 2 :channels formed") + (0.00 ":irc.foonet.org 255 dummy :I have 4 clients and 0 servers") + (0.00 ":irc.foonet.org 265 dummy 4 4 :Current local users 4, max 4") + (0.00 ":irc.foonet.org 266 dummy 4 4 :Current global users 4, max 4") + (0.00 ":irc.foonet.org 422 dummy :MOTD File is missing")) + +((mode 6 "MODE dummy +i") + (0.00 ":irc.foonet.org 221 dummy +i") + (0.00 ":irc.foonet.org NOTICE dummy :This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.") + (0.02 ":irc.foonet.org 221 dummy +i")) + +((join 6.47 "JOIN #spam secret") + (0.03 ":dummy!~u@w9rfqveugz722.irc JOIN #spam")) + +((mode 1 "MODE #spam") + (0.01 ":irc.foonet.org 353 dummy = #spam :~tester dummy") + (0.00 ":irc.foonet.org 366 dummy #spam :End of NAMES list") + (0.01 ":irc.foonet.org 324 dummy #spam +knt secret") + (0.03 ":irc.foonet.org 329 dummy #spam 1653370308")) diff --git a/test/lisp/erc/resources/services/auth-source/libera.eld b/test/lisp/erc/resources/services/auth-source/libera.eld new file mode 100644 index 00000000000..c8dbc9d425a --- /dev/null +++ b/test/lisp/erc/resources/services/auth-source/libera.eld @@ -0,0 +1,49 @@ +;; -*- mode: lisp-data; -*- +((nick 1 "NICK tester")) +((user 1 "USER user 0 * :tester") + (0.26 ":zirconium.libera.chat NOTICE * :*** Checking Ident") + (0.01 ":zirconium.libera.chat NOTICE * :*** Looking up your hostname...") + (0.01 ":zirconium.libera.chat NOTICE * :*** No Ident response") + (0.02 ":zirconium.libera.chat NOTICE * :*** Found your hostname: static-198-54-131-100.cust.tzulo.com") + (0.02 ":zirconium.libera.chat 001 tester :Welcome to the Libera.Chat Internet Relay Chat Network tester") + (0.01 ":zirconium.libera.chat 002 tester :Your host is zirconium.libera.chat[46.16.175.175/6697], running version solanum-1.0-dev") + (0.03 ":zirconium.libera.chat 003 tester :This server was created Wed Jun 9 2021 at 01:38:28 UTC") + (0.02 ":zirconium.libera.chat 004 tester zirconium.libera.chat solanum-1.0-dev DGQRSZaghilopsuwz CFILMPQSbcefgijklmnopqrstuvz bkloveqjfI") + (0.00 ":zirconium.libera.chat 005 tester ETRACE WHOX FNC MONITOR=100 SAFELIST ELIST=CTU CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimnprstuz :are supported by this server") + (0.03 ":zirconium.libera.chat 005 tester CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") + (0.02 ":zirconium.libera.chat 005 tester TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 :are supported by this server") + (0.02 ":zirconium.libera.chat 251 tester :There are 68 users and 37640 invisible on 25 servers") + (0.00 ":zirconium.libera.chat 252 tester 36 :IRC Operators online") + (0.01 ":zirconium.libera.chat 253 tester 5 :unknown connection(s)") + (0.00 ":zirconium.libera.chat 254 tester 19341 :channels formed") + (0.01 ":zirconium.libera.chat 255 tester :I have 3321 clients and 1 servers") + (0.01 ":zirconium.libera.chat 265 tester 3321 4289 :Current local users 3321, max 4289") + (0.00 ":zirconium.libera.chat 266 tester 37708 38929 :Current global users 37708, max 38929") + (0.01 ":zirconium.libera.chat 250 tester :Highest connection count: 4290 (4289 clients) (38580 connections received)") + (0.21 ":zirconium.libera.chat 375 tester :- zirconium.libera.chat Message of the Day - ") + (0.00 ":zirconium.libera.chat 372 tester :- This server provided by Seeweb ") + (0.01 ":zirconium.libera.chat 372 tester :- Welcome to Libera Chat, the IRC network for") + (0.01 ":zirconium.libera.chat 372 tester :- free & open-source software and peer directed projects.") + (0.00 ":zirconium.libera.chat 372 tester :- ") + (0.00 ":zirconium.libera.chat 372 tester :- Use of Libera Chat is governed by our network policies.") + (0.00 ":zirconium.libera.chat 372 tester :- ") + (0.01 ":zirconium.libera.chat 372 tester :- Please visit us in #libera for questions and support.") + (0.01 ":zirconium.libera.chat 372 tester :- ") + (0.01 ":zirconium.libera.chat 372 tester :- Website and documentation: https://libera.chat") + (0.01 ":zirconium.libera.chat 372 tester :- Webchat: https://web.libera.chat") + (0.01 ":zirconium.libera.chat 372 tester :- Network policies: https://libera.chat/policies") + (0.01 ":zirconium.libera.chat 372 tester :- Email: support@libera.chat") + (0.00 ":zirconium.libera.chat 376 tester :End of /MOTD command.")) + +((mode-user 1.2 "MODE tester +i") + (0.02 ":tester MODE tester :+Zi") + (0.02 ":NickServ!NickServ@services.libera.chat NOTICE tester :This nickname is registered. Please choose a different nickname, or identify via \2/msg NickServ IDENTIFY tester \2")) + +((privmsg 2 "PRIVMSG NickServ :IDENTIFY changeme") + (0.96 ":NickServ!NickServ@services.libera.chat NOTICE tester :You are now identified for \2tester\2.") + (0.25 ":NickServ!NickServ@services.libera.chat NOTICE tester :Last login from: \2~tester@school.edu/tester\2 on Jun 18 01:15:56 2021 +0000.")) + +((quit 5 "QUIT :\2ERC\2") + (0.19 ":tester!~user@static-198-54-131-100.cust.tzulo.com QUIT :Client Quit")) + +((linger 1 LINGER)) -- cgit v1.2.3 From 2a05479c221d4a13b15ed731e4eb1c0de99e97ed Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 14 Jul 2022 11:55:52 +0200 Subject: ; Fix typos: prefer American spelling --- doc/lispref/commands.texi | 2 +- doc/lispref/modes.texi | 2 +- doc/misc/eshell.texi | 2 +- doc/misc/modus-themes.org | 8 ++++---- etc/NEWS | 6 +++--- etc/images/README | 2 +- etc/themes/leuven-dark-theme.el | 2 +- lisp/dnd.el | 8 ++++---- lisp/emacs-lisp/byte-opt.el | 2 +- lisp/emacs-lisp/bytecomp.el | 2 +- lisp/emacs-lisp/macroexp.el | 2 +- lisp/erc/erc-backend.el | 2 +- lisp/files.el | 2 +- lisp/icomplete.el | 8 ++++---- lisp/jsonrpc.el | 12 ++++++------ lisp/net/eudc-capf.el | 2 +- lisp/net/eudc.el | 2 +- lisp/org/org-plot.el | 6 +++--- lisp/textmodes/texinfo.el | 2 +- src/haiku_support.cc | 2 +- src/keyboard.c | 2 +- src/lread.c | 2 +- src/nsselect.m | 2 +- .../lisp/erc/resources/base/assoc/bouncer-history/barnet.eld | 2 +- test/lisp/erc/resources/base/assoc/reconplay/foonet.eld | 2 +- test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld | 2 +- test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld | 2 +- test/lisp/erc/resources/base/netid/bouncer/foonet.eld | 2 +- .../erc/resources/base/renick/queries/bouncer-barnet.eld | 2 +- .../lisp/erc/resources/base/reuse-buffers/channel/barnet.eld | 4 ++-- .../erc/resources/base/upstream-reconnect/soju-barnet.eld | 2 +- test/lisp/erc/resources/erc-d/resources/incremental.eld | 2 +- test/lisp/erc/resources/erc-d/resources/no-block.eld | 2 +- test/src/keymap-tests.el | 8 ++++---- 34 files changed, 56 insertions(+), 56 deletions(-) (limited to 'test/lisp/erc/resources/base/reuse-buffers') diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 1718978a395..865fa26b275 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2977,7 +2977,7 @@ returns the key sequence as a vector, never as a string. If an input character is upper-case (or has the shift modifier) and has no key binding, but its lower-case equivalent has one, then @code{read-key-sequence} converts the character to lower case. (This -behaviour can be disabled by setting the +behavior can be disabled by setting the @code{translate-upper-case-key-bindings} user option to @code{nil}.) Note that @code{lookup-key} does not perform case conversion in this way. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 2ba37e413c0..e94093318fc 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -271,7 +271,7 @@ normal-mode}), but tries to force it not to choose any modes in @defun clean-mode Changing the major mode clears out most local variables, but it -doesn't remove all artefacts in the buffer (like text properties and +doesn't remove all artifacts in the buffer (like text properties and overlays). It's rare to change a buffer from one major mode to another (except from @code{fundamental-mode} to everything else), so this is usually not a concern. It can sometimes be convenient (mostly diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index f6ec1e268a0..963657f102a 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1597,7 +1597,7 @@ integration: using the remote shell's pipelining avoids copying the data which will flow through the pipeline to local Emacs buffers and then right back again. -Eshell recognises a special syntax to make it easier to convert +Eshell recognizes a special syntax to make it easier to convert pipelines so as to bypass Eshell's pipelining. Prefixing at least one @code{|}, @code{<} or @code{>} with an asterisk marks a command as intended for the operating system shell. To make it harder to invoke diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 4770e3a5191..d0d985705f1 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -4542,7 +4542,7 @@ The =git-gutter= and =git-gutter-fr= packages default to drawing bitmaps for the indicators they display (e.g. bitmap of a plus sign for added lines). In Doom Emacs, these bitmaps are replaced with contiguous lines which may look nicer, but require a change to the foreground of the -relevant faces to yield the desired colour combinations. +relevant faces to yield the desired color combinations. Since this is Doom-specific, we urge users to apply changes in their local setup. Below is some sample code, based on what we cover at @@ -5519,7 +5519,7 @@ interface virtually unusable. [[#h:5808be52-361a-4d18-88fd-90129d206f9b][Option for links]]. -Again, one must exercise judgement in order to avoid discrimination, +Again, one must exercise judgment in order to avoid discrimination, where "discrimination" refers to: + The treatment of substantially different magnitudes as if they were of @@ -5535,11 +5535,11 @@ usability beyond matters of color---they would be making a not-so-obvious error of treating different cases as if they were the same. -The Modus themes prioritise "thematic consistency" over abstract harmony +The Modus themes prioritize "thematic consistency" over abstract harmony or regularity among their applicable colors. In concrete terms, we do not claim that, say, our yellows are the best complements for our blues because we generally avoid using complementary colors side-by-side, so -it is wrong to optimise for a decontextualised blue+yellow combination. +it is wrong to optimize for a decontextualised blue+yellow combination. Not to imply that our colors do not work well together because they do, just to clarify that consistency of context is what themes must strive for, and that requires widening the scope of the design beyond the diff --git a/etc/NEWS b/etc/NEWS index 19f6879a8c7..57845df9792 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -876,7 +876,7 @@ are met. The conditions are given by the argument, which can be +++ *** New user option 'rcirc-cycle-completion-flag'. Rcirc will use the default 'completion-at-point' mechanism. The -conventional IRC behaviour of completing by cycling through the +conventional IRC behavior of completing by cycling through the available options can be restored by enabling this option. ** Imenu @@ -1221,7 +1221,7 @@ longer available after exiting the recursive edit. This user option controls whether the 'e' (in a "*Backtrace*" buffer or while edebugging) and 'C-x C-e' (while edebugging) commands lead to a (further) backtrace. By default, this variable is nil, -which is a change in behaviour from previous Emacs versions. +which is a change in behavior from previous Emacs versions. +++ *** 'e' in edebug can now take a prefix arg to pretty-print the results. @@ -1452,7 +1452,7 @@ header before sending a message. ** Texinfo Mode --- -*** 'texinfo-mode' now has a specialised 'narrow-to-defun' definition. +*** 'texinfo-mode' now has a specialized 'narrow-to-defun' definition. It narrows to the current node. ** EUDC diff --git a/etc/images/README b/etc/images/README index 72da92427b4..858f33e40ba 100644 --- a/etc/images/README +++ b/etc/images/README @@ -112,7 +112,7 @@ GNOME project). They are not part of Emacs, but are distributed and used by Emacs. They are licensed under either the GNU LGPL v3 or the Creative Commons Attribution-Share Alike 3.0 United States License. -To view a copy of the CC-BY-SA licence, visit +To view a copy of the CC-BY-SA license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el index 3fbb9d6c995..0e162c8bab9 100644 --- a/etc/themes/leuven-dark-theme.el +++ b/etc/themes/leuven-dark-theme.el @@ -792,7 +792,7 @@ more...") `(org-example ((,class (:foreground "#ffff0b" :background "#38203d")))) `(org-footnote ((,class (:underline t :foreground "#ff7138")))) `(org-formula ((,class (:foreground "#0680e1")))) - ;; org-habit colours are thanks to zenburn + ;; org-habit colors are thanks to zenburn `(org-habit-ready-face ((t :background "#7F9F7F"))) ; ,zenburn-green `(org-habit-alert-face ((t :background "#E0CF9F" :foreground "#3F3F3F"))) ; ,zenburn-yellow-1 fg ,zenburn-bg `(org-habit-clear-face ((t :background "#5C888B"))) ; ,zenburn-blue-3 diff --git a/lisp/dnd.el b/lisp/dnd.el index ade61917e96..70852885a86 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -327,7 +327,7 @@ in that list instead." "Begin dragging TEXT from FRAME. Initate a drag-and-drop operation allowing the user to drag text from Emacs to another program (the drop target), then block until -the drop is completed or is cancelled. +the drop is completed or is canceled. If the drop completed, return the action that the drop target actually performed, which can be one of the following symbols: @@ -341,7 +341,7 @@ actually performed, which can be one of the following symbols: - `private', which means the drop target chose to perform an unspecified action. -Return nil if the drop was cancelled. +Return nil if the drop was canceled. TEXT is a string containing text that will be inserted by the program where the drop happened. FRAME is the frame where the @@ -383,7 +383,7 @@ currently being held down. It should only be called upon a "Begin dragging FILE from FRAME. Initate a drag-and-drop operation allowing the user to drag a file from Emacs to another program (the drop target), then block until -the drop happens or is cancelled. +the drop happens or is canceled. Return the action that the drop target actually performed, which can be one of the following symbols: @@ -399,7 +399,7 @@ can be one of the following symbols: - `private', which means the drop target chose to perform an unspecified action. -Return nil if the drop was cancelled. +Return nil if the drop was canceled. FILE is the file name that will be sent to the program where the drop happened. If it is a remote file, Emacs will make a diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index d8a96b3f020..a24a5044562 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -425,7 +425,7 @@ for speeding up processing.") ;; `unwind-protect' is a special form which here takes the shape ;; (unwind-protect EXPR :fun-body UNWIND-FUN). ;; We can treat it as if it were a plain function at this point, - ;; although there are specific optimisations possible. + ;; although there are specific optimizations possible. ;; In particular, the return value of UNWIND-FUN is never used ;; so its body should really be compiled for-effect, but we ;; don't do that right now. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 8df4133b6b0..86681cf4dd4 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4229,7 +4229,7 @@ This function is never called when `lexical-binding' is nil." (byte-defop-compiler-1 quote) (defun byte-compile-setq (form) - (cl-assert (= (length form) 3)) ; normalised in macroexp + (cl-assert (= (length form) 3)) ; normalized in macroexp (let ((var (nth 1 form)) (expr (nth 2 form))) (byte-compile-form expr) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 4db50bbaa9b..6a193a56d2d 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -378,7 +378,7 @@ Assumes the caller has bound `macroexpand-all-environment'." form `(,fn ,var ,new-expr)))) (`(setq . ,args) - ;; Normalise to a sequence of (setq SYM EXPR). + ;; Normalize to a sequence of (setq SYM EXPR). ;; Malformed code is translated to code that signals an error ;; at run time. (let ((nargs (length args))) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index bc7a7d14dc2..8be4894ecbb 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1644,7 +1644,7 @@ Then display the welcome message." "Return list of unescaped components from an \"ISUPPORT\" VALUE." ;; https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-2 ;; - ;; > The server SHOULD send "X", not "X="; this is the normalised form. + ;; > The server SHOULD send "X", not "X="; this is the normalized form. ;; ;; Note: for now, assume the server will only send non-empty values, ;; possibly with printable ASCII escapes. Though in practice, the diff --git a/lisp/files.el b/lisp/files.el index bdceaefb0ff..25b58423649 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8000,7 +8000,7 @@ If RESTART, restart Emacs after killing the current Emacs process." ("Close Without Saving" . no-save) ("Save All" . save-all) ("Cancel" . cancel))) - ('cancel (user-error "Exit cancelled")) + ('cancel (user-error "Exit canceled")) ('save-all (save-some-buffers t))) (save-some-buffers arg t))) (let ((confirm confirm-kill-emacs)) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 381ad5466f5..b1fcf9ae712 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -840,13 +840,13 @@ by `group-function''s second \"transformation\" protocol." while (listp r) count 1)) repeat total-space - for neighbour = nil + for neighbor = nil if (and preds (> space-above 0)) do - (push (setq neighbour (pop preds)) scroll-above) + (push (setq neighbor (pop preds)) scroll-above) (cl-decf space-above) else if (consp succs) collect - (setq neighbour (pop succs)) into scroll-below-aux - while neighbour + (setq neighbor (pop succs)) into scroll-below-aux + while neighbor finally (setq scroll-below scroll-below-aux)) ;; Halfway there... (let* ((selected (propertize (car comps) 'icomplete-selected t)) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index b84e9b74b1f..90833e1c1d7 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -277,7 +277,7 @@ the function is waiting, then it exits immediately, returning CANCEL-ON-INPUT-RETVAL. Any future replies (normal or error) are ignored." (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer - cancelled + canceled (retval (unwind-protect (catch tag @@ -287,26 +287,26 @@ ignored." #'jsonrpc--async-request-1 connection method params :success-fn (lambda (result) - (unless cancelled + (unless canceled (throw tag `(done ,result)))) :error-fn (jsonrpc-lambda (&key code message data) - (unless cancelled + (unless canceled (throw tag `(error (jsonrpc-error-code . ,code) (jsonrpc-error-message . ,message) (jsonrpc-error-data . ,data))))) :timeout-fn (lambda () - (unless cancelled + (unless canceled (throw tag '(error (jsonrpc-error-message . "Timed out"))))) `(,@(when deferred `(:deferred ,deferred)) ,@(when timeout `(:timeout ,timeout))))) (cond (cancel-on-input (unwind-protect (let ((inhibit-quit t)) (while (sit-for 30))) - (setq cancelled t)) - `(cancelled ,cancel-on-input-retval)) + (setq canceled t)) + `(canceled ,cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) ;; In normal operation, cancellation is handled by the ;; timeout function and response filter, but we still have diff --git a/lisp/net/eudc-capf.el b/lisp/net/eudc-capf.el index 68cbfd93ffe..92f0c80493d 100644 --- a/lisp/net/eudc-capf.el +++ b/lisp/net/eudc-capf.el @@ -71,7 +71,7 @@ ;; setting. ;; ;; The value of the variable `eudc-capf-modes' indicates which -;; major modes do such a setup as part of their initialisation +;; major modes do such a setup as part of their initialization ;; code. ;;; Code: diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 9208e40a730..5cfd4e25ec0 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -926,7 +926,7 @@ non-nil, collect results from all servers." `eudc-inline-expansion-format' is expected to return a list.") nil)))) - ;; fallback behaviour (nil function, or non-matching type) + ;; fallback behavior (nil function, or non-matching type) (t (let ((fname (cdr (assq (nth 0 query-attrs) res))) (lname (cdr (assq (nth 1 query-attrs) res))) diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 4507fbe7ddc..7cce678a81b 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el @@ -272,10 +272,10 @@ argument for the FUNCTION." for k in keys collect (cons k (funcall function (lookup k alist1) (lookup k alist2)))))) -(defun org--plot/item-frequencies (values &optional normalise) +(defun org--plot/item-frequencies (values &optional normalize) "Return an alist indicating the frequency of values in VALUES list. -When NORMALISE is non-nil, the count is divided by the number of values." - (let ((normaliser (if normalise (float (length values)) 1))) +When NORMALIZE is non-nil, the count is divided by the number of values." + (let ((normaliser (if normalize (float (length values)) 1))) (cl-loop for (n . m) in (seq-group-by #'identity values) collect (cons n (/ (length m) normaliser))))) diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 5d6f5deae1b..1ac59ddc5fb 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -401,7 +401,7 @@ REPORT-FN is the callback function." source beg end type msg) into diags finally (funcall report-fn diags))) - (flymake-log :warning "Cancelling obsolete check %s" + (flymake-log :warning "Canceling obsolete check %s" proc)) (kill-buffer (process-buffer proc))))))) (process-send-region texinfo--flymake-proc (point-min) (point-max)) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index a3d3b7a17d3..1f7f372a9b4 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -142,7 +142,7 @@ enum struct font_selection_dialog_message { - /* Whether or not font selection was cancelled. */ + /* Whether or not font selection was canceled. */ bool_bf cancel : 1; /* Whether or not a size was explicitly specified. */ diff --git a/src/keyboard.c b/src/keyboard.c index c729d5dfb3e..2863058d633 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12982,7 +12982,7 @@ Emacs allows binding both upper and lower case key sequences to commands. However, if there is a lower case key sequence bound to a command, and the user enters an upper case key sequence that is not bound to a command, Emacs will use the lower case binding. Setting -this variable to nil inhibits this behaviour. */); +this variable to nil inhibits this behavior. */); translate_upper_case_key_bindings = true; DEFVAR_BOOL ("input-pending-p-filter-events", diff --git a/src/lread.c b/src/lread.c index 759cc08946d..0b46a2e4ee5 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4276,7 +4276,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms) /* Catch silly games like #1=#1# */ invalid_syntax ("nonsensical self-reference", readcharfun); - /* Optimisation: since the placeholder is already + /* Optimization: since the placeholder is already a cons, repurpose it as the actual value. This allows us to skip the substitution below, since the placeholder is already referenced diff --git a/src/nsselect.m b/src/nsselect.m index c46bfeaf42a..5b47d746122 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -724,7 +724,7 @@ Return the action that the drop target actually chose to perform, or nil if no action was performed (either because there was no drop target, or the drop was rejected). If RETURN-FRAME is the symbol `now', also return any frame that mouse moves into during the -drag-and-drop operation, whilst simultaneously cancelling it. Any +drag-and-drop operation, whilst simultaneously canceling it. Any other non-nil value means to do the same, but to wait for the mouse to leave FRAME first. diff --git a/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld b/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld index 4b6ccfff38a..35a9a570b6d 100644 --- a/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld +++ b/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld @@ -37,7 +37,7 @@ ((mode 6 "MODE #chan") (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1619593200") - (0.25 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defence, by mercy, 'tis most just.") + (0.25 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.") (0.25 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: The Marshal of France, Monsieur la Far.") (0.25 ":joe!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :mike: And bide the penance of each three years' day.") (0.25 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: Madam, within; but never man so chang'd.") diff --git a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld index 6f50ecca4ef..f916fea2374 100644 --- a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld +++ b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld @@ -28,7 +28,7 @@ (0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:35:55] alice: This is but a custom in your tongue; you bear a graver purpose, I hope.") (0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:16] bob: To imitate them; faults that are rich are fair.") (0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:18] alice: Our Romeo hath not been in bed to-night.") - (0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:21] bob: But, in defence, by mercy, 'tis most just.") + (0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:21] bob: But, in defense, by mercy, 'tis most just.") (0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:25] alice: Younger than she are happy mothers made.") (0.0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.") (0.0 ":irc.foonet.org 305 tester :You are no longer marked as being away")) diff --git a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld index 766035a524c..e2fe1430283 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld @@ -41,7 +41,7 @@ ((mode 5 "MODE #chan") (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1620805269") - (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defence, by mercy, 'tis most just.") + (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.") (0.1 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: The Marshal of France, Monsieur la Far.") (0.1 ":joe!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :mike: And bide the penance of each three years' day.") (0.1 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: Madam, within; but never man so chang'd.") diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld index e3c41e2133a..b99621cc311 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld @@ -36,7 +36,7 @@ (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: More evident than this; for this was stol'n.") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Sell when you can; you are not for all markets.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: There's the fool hangs on your back already.") - (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honour again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.") + (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honor again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: For he hath still been tried a holy man.") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: To have the touches dearest priz'd.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: And must advise the emperor for his good.") diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld index c241c59bb88..b0964fb9537 100644 --- a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld +++ b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld @@ -36,7 +36,7 @@ (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: More evident than this; for this was stol'n.") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Sell when you can; you are not for all markets.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: There's the fool hangs on your back already.") - (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honour again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.") + (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honor again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: For he hath still been tried a holy man.") (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: To have the touches dearest priz'd.") (0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: And must advise the emperor for his good.") diff --git a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld index fc6cdaafe91..0c8cdac0379 100644 --- a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld +++ b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld @@ -35,7 +35,7 @@ ((mode 5 "MODE #chan") (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1622538742") - (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: By favours several which they did bestow.") + (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: By favors several which they did bestow.") (0.1 ":mike!~u@286u8jcpis84e.irc PRIVMSG #chan :joe: You, Roderigo! come, sir, I am for you.")) ((privmsg-a 5 "PRIVMSG rando :Linda said you were gonna kill me.") diff --git a/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld index 82700c5912c..efc2506fd6f 100644 --- a/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld +++ b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld @@ -27,7 +27,7 @@ (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:16] joe: Tush! none but minstrels like of sonneting.") (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:19] mike: Prithee, nuncle, be contented; 'tis a naughty night to swim in. Now a little fire in a wide field were like an old lecher's heart; a small spark, all the rest on's body cold. Look! here comes a walking fire.") (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:22] joe: My name is Edgar, and thy father's son.") - (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:26] mike: Good my lord, be good to me; your honour is accounted a merciful man; good my lord.") + (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:26] mike: Good my lord, be good to me; your honor is accounted a merciful man; good my lord.") (0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:31] joe: Thy child shall live, and I will see it nourish'd.") (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:33] mike: Quick, quick; fear nothing; I'll be at thy elbow.") (0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.") @@ -38,7 +38,7 @@ (0 ":irc.barnet.org 324 tester #chan +nt") (0 ":irc.barnet.org 329 tester #chan 1620205534") (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: That will be given to the loudest noise we make.") - (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If it please your honour, I am the poor duke's constable, and my name is Elbow: I do lean upon justice, sir; and do bring in here before your good honour two notorious benefactors.") + (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If it please your honor, I am the poor duke's constable, and my name is Elbow: I do lean upon justice, sir; and do bring in here before your good honor two notorious benefactors.") (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Following the signs, woo'd but the sign of she.") (0.5 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: That, sir, which I will not report after her.") (0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Boyet, prepare: I will away to-night.") diff --git a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld index b8fc45e57b5..3711eb8f8e6 100644 --- a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld +++ b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld @@ -36,7 +36,7 @@ (0.06 ":joe!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :mike: Once more I'll read the ode that I have writ.") (0.06 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: This is the foul fiend Flibbertigibbet: he begins at curfew, and walks till the first cock; he gives the web and the pin, squints the eye, and makes the harelip; mildews the white wheat, and hurts the poor creature of earth.") (0.06 ":joe!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :mike: Sir, I praise the Lord for you, and so may my parishioners; for their sons are well tutored by you, and their daughters profit very greatly under you: you are a good member of the commonwealth.") - (0.08 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: If it please your honour, I know not well what they are; but precise villains they are, that I am sure of, and void of all profanation in the world that good Christians ought to have.") + (0.08 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: If it please your honor, I know not well what they are; but precise villains they are, that I am sure of, and void of all profanation in the world that good Christians ought to have.") ;; Unexpected disconnect (0.03 ":BouncerServ!BouncerServ@BouncerServ NOTICE tester :disconnected from barnet: failed to handle messages: failed to read IRC command: read tcp [::1]:54990->[::1]:6668: read: software caused connection abort") ;; Eventual reconnect diff --git a/test/lisp/erc/resources/erc-d/resources/incremental.eld b/test/lisp/erc/resources/erc-d/resources/incremental.eld index ab940fe6129..a1b48495ec3 100644 --- a/test/lisp/erc/resources/erc-d/resources/incremental.eld +++ b/test/lisp/erc/resources/erc-d/resources/incremental.eld @@ -30,7 +30,7 @@ ((mode 3 "MODE #foo") (0.0 ":irc.foo.net 324 tester #foo +Cint") (0.0 ":irc.foo.net 329 tester #foo 1519850102") - (0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defence, by mercy, 'tis most just.") + (0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defense, by mercy, 'tis most just.") (0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: Grows, lives, and dies, in single blessedness.") (0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :Look for me.") (0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: By this hand, it will not kill a fly. But come, now I will be your Rosalind in a more coming-on disposition; and ask me what you will, I will grant it.") diff --git a/test/lisp/erc/resources/erc-d/resources/no-block.eld b/test/lisp/erc/resources/erc-d/resources/no-block.eld index 1b1f3965637..2811923d8ac 100644 --- a/test/lisp/erc/resources/erc-d/resources/no-block.eld +++ b/test/lisp/erc/resources/erc-d/resources/no-block.eld @@ -36,7 +36,7 @@ ((mode-foo 1.2 "MODE #foo") (0.0 ":irc.example.org 324 tester #foo +Cint") (0.0 ":irc.example.org 329 tester #foo 1519850102") - (-0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defence, by mercy, 'tis most just.") + (-0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defense, by mercy, 'tis most just.") (-0.2 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: Grows, lives, and dies, in single blessedness.") (-0.3 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: For these two hours, Rosalind, I will leave thee.") (-0.4 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: By this hand, it will not kill a fly. But come, now I will be your Rosalind in a more coming-on disposition; and ask me what you will, I will grant it.") diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index de3012b5764..b0876664ed1 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -135,7 +135,7 @@ (should (eq (lookup-key map [menu-bar I-bar]) 'foo)))) (ert-deftest keymap-lookup-key/mixed-case-multibyte () - "Backwards compatibility behaviour (Bug#50752)." + "Backwards compatibility behavior (Bug#50752)." (let ((map (make-keymap))) ;; (downcase "Åäö") => "åäö" (define-key map [menu-bar åäö bar] 'foo) @@ -153,19 +153,19 @@ (should (eq (lookup-key map [menu-bar buffer 1]) 'foo)))) (ert-deftest keymap-lookup-keymap/with-spaces () - "Backwards compatibility behaviour (Bug#50752)." + "Backwards compatibility behavior (Bug#50752)." (let ((map (make-keymap))) (define-key map [menu-bar foo-bar] 'foo) (should (eq (lookup-key map [menu-bar Foo\ Bar]) 'foo)))) (ert-deftest keymap-lookup-keymap/with-spaces-multibyte () - "Backwards compatibility behaviour (Bug#50752)." + "Backwards compatibility behavior (Bug#50752)." (let ((map (make-keymap))) (define-key map [menu-bar åäö-bar] 'foo) (should (eq (lookup-key map [menu-bar Åäö\ Bar]) 'foo)))) (ert-deftest keymap-lookup-keymap/with-spaces-multibyte-lang-env () - "Backwards compatibility behaviour (Bug#50752)." + "Backwards compatibility behavior (Bug#50752)." (let ((lang-env current-language-environment)) (set-language-environment "Turkish") (let ((map (make-keymap))) -- cgit v1.2.3