]> arthur.barton.de Git - ngircd-alex.git/blob - src/testsuite/message-test.e
PRIVMSG/NOTICE: handle nick!user@host masks case-insensitive
[ngircd-alex.git] / src / testsuite / message-test.e
1 spawn telnet localhost 6789
2 expect {
3         timeout { exit 1 }
4         "Connected"
5 }
6
7 send "nick nick\r"
8 send "user user . . :User\r"
9 expect {
10         timeout { exit 1 }
11         "376"
12 }
13
14 send "privmsg nick :test\r"
15 expect {
16         timeout { exit 1 }
17         "@* PRIVMSG nick :test"
18 }
19
20 send "privmsg nick\r"
21 expect {
22         timeout { exit 1 }
23         "412"
24 }
25
26 send "privmsg\r"
27 expect {
28         timeout { exit 1 }
29         "411"
30 }
31
32 send "privmsg nick,nick :test\r"
33 expect {
34         timeout { exit 1 }
35         "@* PRIVMSG nick :test\r*@* PRIVMSG nick :test"
36 }
37
38 send "privmsg Nick,#testChannel,nick :test\r"
39 expect {
40         timeout { exit 1 }
41         "@* PRIVMSG nick :test\r*401*@* PRIVMSG nick :test"
42 }
43
44 send "privmsg doesnotexist :test\r"
45 expect {
46         timeout { exit 1 }
47         "401"
48 }
49
50 send "privmsg ~UsEr@ngIRCd.Test.Server :test\r"
51 expect {
52         timeout { exit 1 }
53         "@* PRIVMSG nick :test"
54 }
55
56 # The following two tests using "localhost" as host name
57 # had to be disabled, because there are operating systems
58 # out there, that use "localhost.<domain>" as host name
59 # for 127.0.0.1 instead of just "localhost".
60 # (for example OpenBSD 4, OpenSolaris, ...)
61 #
62 #send "privmsg ~user\%localhost :test\r"
63 #expect {
64 #       timeout { exit 1 }
65 #       "@* PRIVMSG nick :test"
66 #}
67 #
68 #send "privmsg Nick!~User@LocalHost :test\r"
69 #expect {
70 #       timeout { exit 1 }
71 #       "@* PRIVMSG nick :test"
72 #       "401"
73 #}
74
75 send "away :away\r"
76 expect {
77         timeout { exit 1 }
78         "306"
79 }
80
81 send "privmsg nick :test\r"
82 expect {
83         timeout { exit 1 }
84         "301"
85 }
86
87 send "away\r"
88 expect {
89         timeout { exit 1 }
90         "305"
91 }
92
93 send "privmsg \$ngircd.test.server :test\r"
94 expect {
95         timeout { exit 1 }
96         "481"
97 }
98
99 send "privmsg #*.de :test\r"
100 expect {
101         timeout { exit 1 }
102         "481"
103 }
104
105 send "oper TestOp 123\r"
106
107 send "privmsg \$ngircd.test.server :test\r"
108 expect {
109         timeout { exit 1 }
110         "@* PRIVMSG nick :test"
111 }
112
113 send "privmsg \$*.test*.server :test\r"
114 expect {
115         timeout { exit 1 }
116         "@* PRIVMSG nick :test"
117 }
118
119 send "privmsg \$noDotServer :test\r"
120 expect {
121         timeout { exit 1 }
122         "401"
123 }
124
125 #cannot test host mask since localhost has no '.' as RFC requires
126
127 send "quit\r"
128 expect {
129         timeout { exit 1 }
130         "Connection closed"
131 }
132
133 # -eof-