ircu2.10.12 pk910 fork
[ircu2.10.12-pk.git] / tests / bug-1640796.cmd
1 define srv1 localhost:7601
2 define srv1-name irc.example.net
3 define hidden-srv *.undernet.org
4 define channel #random-channel
5 define cl1-nick Ch4n0pm4n
6 define cl2-nick D00dm4n
7
8 # Connect two clients.  Join one to the test channel.
9 connect cl1 %cl1-nick% op3rm4n %srv1% :Some Chanop
10 connect cl2 %cl2-nick% d00dm4n %srv1% :Someone Else
11 :cl1 join %channel%
12 :cl1 mode %channel% +D
13 :cl1 expect %cl1-nick% mode %channel% \\+D
14
15 # Now join the other client, and let the chanop remove -D.  Both
16 # should see the channel become +d.
17 :cl2 wait cl1
18 :cl2 join %channel%
19 :cl1 wait cl2
20 :cl1 mode %channel% -D
21 :cl1 expect %cl1-nick% mode %channel% -D\\+d
22 :cl2 expect %cl1-nick% mode %channel% -D\\+d
23
24 # Bug 1640796 is that if the chanop sends +D-D, the channel is
25 # improperly marked -d.  (An empty mode change is also sent to other
26 # servers.)
27 :cl1 mode %channel% +D-D
28 :cl1 mode %channel%
29 :cl1 expect %srv1-name% 324 %cl1-nick% %channel% \\+.*d
30
31 # Make sure that client 1 does see the -d when client 2 quits
32 :cl2 wait cl1
33 :cl2 part %channel% leaving
34 :cl1 expect %hidden-srv% mode %channel% -d
35 :cl1 quit done