From 4d152b771e17c23823af995f86912d1550f4c244 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 11 Feb 2008 11:06:31 +0000 Subject: Make IRC_WHO also search username/servername/hostname. Dana Dahlstrom reported that IRC_WHO did not follow RFC 2812, Section 3.6.1. Specifically: - IRC_WHO did not send "G" flag instead if "H" if client was away - did not search username/servername/hostname etc. if argument was not a channel. Fix all of the above and tidy things up a bit. Also add IRC_WHO test script contributed by Dana. --- src/testsuite/who-away-test.e | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 src/testsuite/who-away-test.e (limited to 'src/testsuite/who-away-test.e') diff --git a/src/testsuite/who-away-test.e b/src/testsuite/who-away-test.e new file mode 100644 index 00000000..e5e442a0 --- /dev/null +++ b/src/testsuite/who-away-test.e @@ -0,0 +1,100 @@ +# $Id: who-away-test.e,v 1.1 2008/02/11 11:06:32 fw Exp $ + +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 "who\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "who 0\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "who *\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "away :testing\r" +expect { + timeout { exit 1 } + "306 nick" +} + +send "who localhost\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" +} + +send "who ngircd.test.server\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" +} + +send "who Real?Name\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" +} + +send "who nick\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" +} + +send "away\r" +expect { + timeout { exit 1 } + "305 nick" +} + +send "who *cal*ho??\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "who *.server\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "who Real*me\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "who n?c?\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "quit\r" +expect { + timeout { exit 1 } + "Connection closed" +} + +# -eof- -- cgit 1.4.1