summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-08 18:22:47 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-08 18:22:47 +0100
commit1fb099ceb0269e8e74bd0f8dc98eb1da156becbd (patch)
treee6d27f84a4a6514f2308d80bce57d13eb4d2714a /test
parentef711b1556f83c9aa841fec9927672245408fc9c (diff)
downloademacs-1fb099ceb0269e8e74bd0f8dc98eb1da156becbd.tar.gz
Make rcirc nick renaming heed nickname max lengths
* lisp/net/rcirc.el (rcirc-server-parameters): New variable (bug#6795). (rcirc-connect): Set it. (rcirc-handler-433): Use the length from the server. (rcirc-handler-005): Collect server data. (rcirc-server-parameter-value): New utility function. (rcirc--make-new-nick): New function.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/rcirc-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/net/rcirc-tests.el b/test/lisp/net/rcirc-tests.el
index 285926af9d2..cbd1c2be830 100644
--- a/test/lisp/net/rcirc-tests.el
+++ b/test/lisp/net/rcirc-tests.el
@@ -51,4 +51,16 @@
"MODE #cchan +kl :a:b"
nil "MODE" '("#cchan" "+kl" "a:b")))
+(ert-deftest rcirc-rename-nicks ()
+ (should (equal (rcirc--make-new-nick "foo" 16)
+ "foo`"))
+ (should (equal (rcirc--make-new-nick "123456789012345" 16)
+ "123456789012345`"))
+ (should (equal (rcirc--make-new-nick "1234567890123456" 16)
+ "123456789012345`"))
+ (should (equal (rcirc--make-new-nick "123456789012345`" 16)
+ "12345678901234``"))
+ (should (equal (rcirc--make-new-nick "123456789012````" 16)
+ "12345678901`````")))
+
;;; rcirc-tests.el ends here