diff options
| author | F. Jason Park | 2023-02-18 19:32:36 -0800 |
|---|---|---|
| committer | F. Jason Park | 2023-04-08 14:23:50 -0700 |
| commit | e69bd59ec59784b2f646e93355d4d63f41426cfc (patch) | |
| tree | fff6062e04cf60606943301ca0528b895ef78350 /test | |
| parent | 8c0c98268440b27a77faf30738dfd72c909bb33f (diff) | |
| download | emacs-e69bd59ec59784b2f646e93355d4d63f41426cfc.tar.gz emacs-e69bd59ec59784b2f646e93355d4d63f41426cfc.zip | |
Honor arbitrary CHANTYPES in ERC
* lisp/erc/erc.el (erc-channel-p): Favor "CHANTYPES" ISUPPORT item
before falling back to well known prefixes.
* test/lisp/erc/erc-tests.el (erc-channel-p): Add test. Arbitrarily
bundled with bug#60954.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/erc/erc-tests.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index d6c63934163..bbf3269161d 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el | |||
| @@ -447,6 +447,27 @@ | |||
| 447 | (should (equal (erc-downcase "Tilde~") "tilde~" )) | 447 | (should (equal (erc-downcase "Tilde~") "tilde~" )) |
| 448 | (should (equal (erc-downcase "\\O/") "|o/" ))))) | 448 | (should (equal (erc-downcase "\\O/") "|o/" ))))) |
| 449 | 449 | ||
| 450 | (ert-deftest erc-channel-p () | ||
| 451 | (let ((erc--isupport-params (make-hash-table)) | ||
| 452 | erc-server-parameters) | ||
| 453 | |||
| 454 | (should (erc-channel-p "#chan")) | ||
| 455 | (should (erc-channel-p "##chan")) | ||
| 456 | (should (erc-channel-p "&chan")) | ||
| 457 | (should (erc-channel-p "+chan")) | ||
| 458 | (should (erc-channel-p "!chan")) | ||
| 459 | (should-not (erc-channel-p "@chan")) | ||
| 460 | |||
| 461 | (push '("CHANTYPES" . "#&@+!") erc-server-parameters) | ||
| 462 | |||
| 463 | (should (erc-channel-p "!chan")) | ||
| 464 | (should (erc-channel-p "#chan")) | ||
| 465 | |||
| 466 | (with-current-buffer (get-buffer-create "#chan") | ||
| 467 | (setq erc--target (erc--target-from-string "#chan"))) | ||
| 468 | (should (erc-channel-p (get-buffer "#chan")))) | ||
| 469 | (kill-buffer "#chan")) | ||
| 470 | |||
| 450 | (ert-deftest erc--valid-local-channel-p () | 471 | (ert-deftest erc--valid-local-channel-p () |
| 451 | (ert-info ("Local channels not supported") | 472 | (ert-info ("Local channels not supported") |
| 452 | (let ((erc--isupport-params (make-hash-table))) | 473 | (let ((erc--isupport-params (make-hash-table))) |