Test script proposed by Dana Dahlstrom, 2008-02-17.
See <https://arthur.barton.de/bugzilla/show_bug.cgi?id=72> ...
opless-channel-test
server-link-test
who-test
+whois-test
ngircd-test1.log
ngircd-test2.log
ngircd-test1.motd
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
--- /dev/null
+# 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-