all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob c830e9d2c871c142375916805952d6c6bd10c235 3367 bytes (raw)
name: test/lisp/erc/erc-scenarios-ignore.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
;;; erc-scenarios-ignore.el --- Misc commands for ERC -*- lexical-binding: t -*-

;; Copyright (C) 2023-2024 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 <https://www.gnu.org/licenses/>.

;;; Commentary:

;; TODO add test covering the same ignored speaker in two different
;; channels on the same server: they should be ignored in both.

;;; Code:

(require 'ert-x)
(eval-and-compile
  (let ((load-path (cons (ert-resource-directory) load-path)))
    (require 'erc-scenarios-common)))

(ert-deftest erc-scenarios-ignore/basic ()
  :tags '(:expensive-test)
  (erc-scenarios-common-with-cleanup
      ((erc-scenarios-common-dialog "base/assoc/multi-net")
       (erc-server-flood-penalty 0.1)
       (dumb-server-foonet (erc-d-run "localhost" t 'foonet))
       (dumb-server-barnet (erc-d-run "localhost" t 'barnet))
       (erc-autojoin-channels-alist '((foonet "#chan") (barnet "#chan")))
       (port-foonet (process-contact dumb-server-foonet :service))
       (port-barnet (process-contact dumb-server-barnet :service))
       (expect (erc-d-t-make-expecter)))

    (ert-info ("Connect to two networks")
      (with-current-buffer (erc :server "127.0.0.1"
                                :port port-barnet
                                :nick "tester"
                                :password "changeme"
                                :full-name "tester"))
      (with-current-buffer (erc :server "127.0.0.1"
                                :port port-foonet
                                :nick "tester"
                                :password "changeme"
                                :full-name "tester")
        (funcall expect 10 "debug mode")))

    (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#chan@foonet"))
      (funcall expect 10 "<bob> tester, welcome!")
      (funcall expect 10 "<alice> tester, welcome!")
      (erc-scenarios-common-say "/ignore alice 1m")
      (erc-scenarios-common-say "/ignore mike 1h")
      (funcall expect 10 "ignoring alice for 1m0s")
      (funcall expect 10 "<bob> alice: Signior Iachimo")
      (erc-scenarios-common-say "/ignore")
      (funcall expect 10 "alice    60s")
      (funcall expect 10 "mike     59m60s")
      (funcall expect -0.1 "<alice>")
      (funcall expect 10 "<bob> alice: The ground is bloody")
      (erc-scenarios-common-say "/unignore alice")
      (funcall expect 10 "<alice>"))

    ;; No <mike> messages were ignored on network barnet.
    (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#chan@barnet"))
      (funcall expect 10 "<mike> tester, welcome!")
      (funcall expect 10 "<joe> tester, welcome!")
      (funcall expect 10 "<mike> joe: Whipp'd")
      (funcall expect 10 "<mike> joe: Double"))))

;;; erc-scenarios-ignore.el ends here

debug log:

solving c830e9d2c87 ...
found c830e9d2c87 in https://yhetil.org/emacs/87edbnei8m.fsf@neverwas.me/

applying [1/1] https://yhetil.org/emacs/87edbnei8m.fsf@neverwas.me/
diff --git a/test/lisp/erc/erc-scenarios-ignore.el b/test/lisp/erc/erc-scenarios-ignore.el
new file mode 100644
index 00000000000..c830e9d2c87

Checking patch test/lisp/erc/erc-scenarios-ignore.el...
Applied patch test/lisp/erc/erc-scenarios-ignore.el cleanly.

index at:
100644 c830e9d2c871c142375916805952d6c6bd10c235	test/lisp/erc/erc-scenarios-ignore.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.