summaryrefslogtreecommitdiff
path: root/ngircd/src/testsuite/invite-test.e
blob: f3115a3d10da6f352b03a1de007f3587d7cdcce6 (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# ngIRCd test suite
# INVITE test

spawn telnet 127.0.0.1 6789
expect {
	timeout { exit 1 }
	"Connected"
}

send "nick nick\r"
send "user user . . :User\r"
expect {
	timeout { exit 1 }
	"376"
}

send "invite\r"
expect {
	timeout { exit 1 }
	"461"
}

send "invite nick\r"
expect {
	timeout { exit 1 }
	"461"
}

send "invite nick #channel\r"
expect {
	timeout { exit 1 }
	-re "INVITE nick :?#channel"
}
expect {
	timeout { exit 1 }
	-re "341 nick nick :?#channel"
}

send "invite nosuchnic #TopicChannel\r"
expect {
	timeout { exit 1 }
	"401 nick nosuchnic :No such nick or channel name"
}

send "invite nick #TopicChannel\r"
expect {
	timeout { exit 1 }
	"442 nick #TopicChannel :You are not on that channel"
}

send "join #channel\r"
expect {
	timeout { exit 1 }
	-re "JOIN :?#channel"
}

send "invite nick #channel\r"
expect {
	timeout { exit 1 }
	"443 nick nick #channel :is already on channel"
}

send "mode #channel +i\r"
expect {
	timeout { exit 1 }
	"MODE #channel +i"
}

send "mode #channel -o nick\r"
expect {
	timeout { exit 1 }
	"MODE #channel -o nick"
}

send "invite nick #channel\r"
expect {
	timeout { exit 1 }
	"482 nick #channel :You are not channel operator"
	#it would be reasonable to expect 443 here instead
}

send "part #channel\r"
expect {
	timeout { exit 1}
	"@* PART #channel :"
}

send "invite nick :parameter with spaces\r"
expect {
	timeout { exit 1 }
	"INVITE nick :parameter with spaces"
}
expect {
	timeout { exit 1 }
	"341 nick nick :parameter with spaces"
}

send "away message\r"
expect {
	timeout { exit 1 }
	"306 nick :You have been marked as being away"
}

send "INVITE nick #channel\r"
expect {
	timeout { exit 1 }
	-re "301 nick nick :?message"
}

send "quit\r"
expect {
	timeout { exit 1 }
	"ERROR :Closing connection"
}