aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/erc/erc-tests.el37
1 files changed, 35 insertions, 2 deletions
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index acd470a1e17..45d8cae5125 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1353,6 +1353,39 @@
1353 ;; Default unchanged 1353 ;; Default unchanged
1354 (should (equal (erc-migrate-modules erc-modules) erc-modules))) 1354 (should (equal (erc-migrate-modules erc-modules) erc-modules)))
1355 1355
1356(ert-deftest erc--find-group ()
1357 ;; These two are loaded by default
1358 (should (eq (erc--find-group 'keep-place nil) 'erc))
1359 (should (eq (erc--find-group 'networks nil) 'erc-networks))
1360 ;; These are fake
1361 (cl-letf (((get 'erc-bar 'group-documentation) "")
1362 ((get 'baz 'erc-group) 'erc-foo))
1363 (should (eq (erc--find-group 'foo 'bar) 'erc-bar))
1364 (should (eq (erc--find-group 'bar 'foo) 'erc-bar))
1365 (should (eq (erc--find-group 'bar nil) 'erc-bar))
1366 (should (eq (erc--find-group 'foo nil) 'erc))
1367 (should (eq (erc--find-group 'fake 'baz) 'erc-foo))))
1368
1369(ert-deftest erc--find-group--real ()
1370 :tags '(:unstable)
1371 (require 'erc-services)
1372 (require 'erc-stamp)
1373 (require 'erc-sound)
1374 (require 'erc-page)
1375 (require 'erc-join)
1376 (require 'erc-capab)
1377 (require 'erc-pcomplete)
1378 (should (eq (erc--find-group 'services 'nickserv) 'erc-services))
1379 (should (eq (erc--find-group 'stamp 'timestamp) 'erc-stamp))
1380 (should (eq (erc--find-group 'sound 'ctcp-sound) 'erc-sound))
1381 (should (eq (erc--find-group 'page 'ctcp-page) 'erc-page))
1382 (should (eq (erc--find-group 'autojoin) 'erc-autojoin))
1383 (should (eq (erc--find-group 'pcomplete 'Completion) 'erc-pcomplete))
1384 (should (eq (erc--find-group 'capab-identify) 'erc-capab))
1385 ;; No group specified.
1386 (should (eq (erc--find-group 'smiley nil) 'erc))
1387 (should (eq (erc--find-group 'unmorse nil) 'erc)))
1388
1356(ert-deftest erc--update-modules () 1389(ert-deftest erc--update-modules ()
1357 (let (calls 1390 (let (calls
1358 erc-modules 1391 erc-modules
@@ -1453,7 +1486,7 @@ and disable it otherwise. If called from Lisp, enable the mode
1453if ARG is omitted or nil. 1486if ARG is omitted or nil.
1454Some docstring" 1487Some docstring"
1455 :global t 1488 :global t
1456 :group 'erc-mname 1489 :group (erc--find-group 'mname 'malias)
1457 (if erc-mname-mode 1490 (if erc-mname-mode
1458 (erc-mname-enable) 1491 (erc-mname-enable)
1459 (erc-mname-disable))) 1492 (erc-mname-disable)))
@@ -1499,7 +1532,7 @@ and disable it otherwise. If called from Lisp, enable the mode
1499if ARG is omitted or nil. 1532if ARG is omitted or nil.
1500Some docstring" 1533Some docstring"
1501 :global nil 1534 :global nil
1502 :group 'erc-mname 1535 :group (erc--find-group 'mname nil)
1503 (if erc-mname-mode 1536 (if erc-mname-mode
1504 (erc-mname-enable) 1537 (erc-mname-enable)
1505 (erc-mname-disable))) 1538 (erc-mname-disable)))