; Slightly improve test case for erc-parse-modes
* lisp/erc/erc.el (erc--merge-local-modes): Look for a symbol's `erc-module' property before examining its name. * test/lisp/erc/erc-tests.el (erc-parse-modes): Expand case to cover alternating plus and minus mode changes.
This commit is contained in:
parent
d719a81409
commit
dc7c38ed9e
2 changed files with 6 additions and 3 deletions
|
@ -2519,9 +2519,9 @@ nil."
|
|||
(if old-vars
|
||||
(let ((out (list (reverse new-modes))))
|
||||
(pcase-dolist (`(,k . ,v) old-vars)
|
||||
(when (and (string-prefix-p "erc-" (symbol-name k))
|
||||
(string-suffix-p "-mode" (symbol-name k))
|
||||
(get k 'erc-module))
|
||||
(when (and (get k 'erc-module)
|
||||
(string-prefix-p "erc-" (symbol-name k))
|
||||
(string-suffix-p "-mode" (symbol-name k)))
|
||||
(if v
|
||||
(cl-pushnew k (car out))
|
||||
(setf (car out) (delq k (car out)))
|
||||
|
|
|
@ -825,8 +825,11 @@
|
|||
(should (equal (erc-parse-modes "-o bob") '(nil nil (("o" off "bob")))))
|
||||
(should (equal (erc-parse-modes "+uo bob") '(("u") nil (("o" on "bob")))))
|
||||
(should (equal (erc-parse-modes "+o-u bob") '(nil ("u") (("o" on "bob")))))
|
||||
|
||||
(should (equal (erc-parse-modes "+uo-tv bob alice")
|
||||
'(("u") ("t") (("o" on "bob") ("v" off "alice")))))
|
||||
(should (equal (erc-parse-modes "+u-t+o-v bob alice")
|
||||
'(("u") ("t") (("o" on "bob") ("v" off "alice")))))
|
||||
|
||||
(ert-info ("Modes of type B are always grouped as unary")
|
||||
(should (equal (erc-parse-modes "+k h2") '(nil nil (("k" on "h2")))))
|
||||
|
|
Loading…
Add table
Reference in a new issue