1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-11-06 08:52:58 +00:00

Allow KICK to handle comma-delimited lists (of channels, nicks).

includes test cases.

[fw@strlen.de:
	- move code around to avoid duplication
	- use const where possible
	- integrate test case]
This commit is contained in:
Bryan Caldwell
2008-05-05 16:04:48 +02:00
committed by Florian Westphal
parent 3283d275ba
commit 3d8eda9c86
4 changed files with 204 additions and 18 deletions

View File

@@ -21,6 +21,7 @@ EXTRA_DIST = \
start-server.sh stop-server.sh tests.sh stress-server.sh \
test-loop.sh wait-tests.sh \
channel-test.e connect-test.e check-idle.e misc-test.e mode-test.e \
kick-test.e \
opless-channel-test.e \
who-test.e stress-A.e stress-B.e \
ngircd-test.conf
@@ -48,6 +49,10 @@ channel-test: tests.sh
rm -f channel-test
ln -s $(srcdir)/tests.sh channel-test
kick-test: tests.sh
rm -f kick-test
ln -s $(srcdir)/tests.sh kick-test
opless-channel-test: tests.sh
rm -f opless-channel-test
ln -s $(srcdir)/tests.sh opless-channel-test
@@ -67,6 +72,7 @@ mode-test: tests.sh
TESTS = start-server.sh \
connect-test \
channel-test \
kick-test \
misc-test \
mode-test \
who-test \

112
src/testsuite/kick-test.e Normal file
View File

@@ -0,0 +1,112 @@
spawn telnet localhost 6789
expect {
timeout { exit 1 }
"Connected"
}
send "nick nick\r"
send "user user . . :User\r"
expect {
timeout { exit 1 }
"376"
}
send "kick #Channel nick\r"
expect {
timeout { exit 1 }
"403"
}
send "join #Channel\r"
send "kick #Channel nick\r"
expect {
timeout { exit 1 }
"@* KICK #Channel nick :nick"
}
send "join #Channel\r"
send "kick #Channel nick :reason\r"
expect {
timeout { exit 1 }
"@* KICK #Channel nick :reason"
}
send "join #Channel,#Channel2\r"
send "kick #Channel,#Channel2 nick\r"
expect {
timeout { exit 1 }
"461"
}
send "kick #Channel,#Channel2,#NoExists,#NoExists nick1,nick,nick3,nick :reason\r"
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"@* KICK #Channel2 nick :reason"
}
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"403"
}
send "kick #Channel nick2,nick,nick3\r"
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"@* KICK #Channel nick :nick"
}
expect {
timeout { exit 1 }
"401"
}
send "kick #Channel ,,\r"
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"401"
}
send "kick ,, ,,,\r"
expect {
timeout { exit 1 }
"461"
}
send "kick ,, ,,\r"
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"401"
}
expect {
timeout { exit 1 }
"401"
}
send "quit\r"
expect {
timeout { exit 1 }
"Connection closed"
}
# -eof-