commit - ff2a425ab899a782145186d4e9a829ea9950fb47
commit + d1f604ab89f34412cbe44aaf323b450b800a49d9
blob - fd628e3dc9c5515a7faf1e3a31ed958ad4f8eae3
blob + 5884a486590f98b275cb7b52a1187349b377035e
--- src/testsuite/.gitignore
+++ src/testsuite/.gitignore
opless-channel-test
server-link-test
who-test
+whois-test
ngircd-test1.log
ngircd-test2.log
ngircd-test1.motd
blob - 52cc31a6154b6fde8371de361c8126717bc6cd20
blob + 9dc76a7d90f47e5a8b8c79b7d22d8fbdd52b6ca2
--- src/testsuite/Makefile.am
+++ src/testsuite/Makefile.am
test-loop.sh wait-tests.sh \
channel-test.e connect-test.e check-idle.e invite-test.e \
join-test.e kick-test.e message-test.e misc-test.e mode-test.e \
- opless-channel-test.e server-link-test.e who-test.e \
+ opless-channel-test.e server-link-test.e who-test.e whois-test.e \
stress-A.e stress-B.e \
start-server1 stop-server1 ngircd-test1.conf \
start-server2 stop-server2 ngircd-test2.conf
blob - /dev/null
blob + 7024d5ff74efa3c3a51d674d30bc13c9f748593e (mode 644)
--- /dev/null
+++ src/testsuite/whois-test.e
+# ngIRCd test suite
+# WHOIS test
+
+spawn telnet localhost 6789
+expect {
+ timeout { exit 1 }
+ "Connected"
+}
+
+send "nick nick\r"
+send "user user . . :Real Name\r"
+expect {
+ timeout { exit 1 }
+ "376"
+}
+
+send "whois nick\r"
+expect {
+ timeout { exit 1 }
+ "311 nick nick ~user localhost \* :Real Name\r"
+}
+
+send "whois *\r"
+expect {
+ timeout { exit 1 }
+ "311 nick nick ~user localhost \* :Real Name\r"
+}
+
+send "whois n*\r"
+expect {
+ timeout { exit 1 }
+ "311 nick nick ~user localhost \* :Real Name\r"
+}
+
+send "whois ?ick\r"
+expect {
+ timeout { exit 1 }
+ "311 nick nick ~user localhost \* :Real Name\r"
+}
+
+send "whois ????,n?*k\r"
+expect {
+ timeout { exit 1 }
+ "311 nick nick ~user localhost \* :Real Name\r"
+}
+
+send "quit\r"
+expect {
+ timeout { exit 1 }
+ "ERROR"
+}
+
+# -eof-