]> arthur.barton.de Git - ngircd-alex.git/blob - src/testsuite/invite-test.e
Fix "WHO #<chan>" showing invisible users and hiding all visible
[ngircd-alex.git] / src / testsuite / invite-test.e
1 # ngIRCd test suite
2 # INVITE test
3
4 spawn telnet 127.0.0.1 6789
5 expect {
6         timeout { exit 1 }
7         "Connected"
8 }
9
10 send "nick nick\r"
11 send "user user . . :User\r"
12 expect {
13         timeout { exit 1 }
14         "376"
15 }
16
17 send "invite\r"
18 expect {
19         timeout { exit 1 }
20         "461"
21 }
22
23 send "invite nick\r"
24 expect {
25         timeout { exit 1 }
26         "461"
27 }
28
29 send "invite nick #channel\r"
30 expect {
31         timeout { exit 1 }
32         -re "INVITE nick :?#channel"
33 }
34 expect {
35         timeout { exit 1 }
36         -re "341 nick nick :?#channel"
37 }
38
39 send "invite nosuchnic #TopicChannel\r"
40 expect {
41         timeout { exit 1 }
42         "401 nick nosuchnic :No such nick or channel name"
43 }
44
45 send "invite nick #TopicChannel\r"
46 expect {
47         timeout { exit 1 }
48         "442 nick #TopicChannel :You are not on that channel"
49 }
50
51 send "join #channel\r"
52 expect {
53         timeout { exit 1 }
54         -re "JOIN :?#channel"
55 }
56
57 send "invite nick #channel\r"
58 expect {
59         timeout { exit 1 }
60         "443 nick nick #channel :is already on channel"
61 }
62
63 send "mode #channel +i\r"
64 expect {
65         timeout { exit 1 }
66         "MODE #channel +i"
67 }
68
69 send "mode #channel -o nick\r"
70 expect {
71         timeout { exit 1 }
72         "MODE #channel -o nick"
73 }
74
75 send "invite nick #channel\r"
76 expect {
77         timeout { exit 1 }
78         "482 nick #channel :You are not channel operator"
79         #it would be reasonable to expect 443 here instead
80 }
81
82 send "part #channel\r"
83 expect {
84         timeout { exit 1}
85         -re "PART #channel :?nick"
86 }
87
88 send "invite nick :parameter with spaces\r"
89 expect {
90         timeout { exit 1 }
91         "INVITE nick :parameter with spaces"
92 }
93 expect {
94         timeout { exit 1 }
95         "341 nick nick :parameter with spaces"
96 }
97
98 send "away message\r"
99 expect {
100         timeout { exit 1 }
101         "306 nick :You have been marked as being away"
102 }
103
104 send "INVITE nick #channel\r"
105 expect {
106         timeout { exit 1 }
107         -re "301 nick nick :?message"
108 }
109
110 send "quit\r"
111 expect {
112         timeout { exit 1 }
113         "Connection closed"
114 }