diff options
| author | Florian Westphal <fw@strlen.de> | 2008-02-11 11:06:31 +0000 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2008-02-26 23:49:33 +0100 |
| commit | 4d152b771e17c23823af995f86912d1550f4c244 (patch) | |
| tree | a96e59afae7c91b64a9422b53473fc6ca79f8a77 /src/testsuite/who-away-test.e | |
| parent | c634303765c20083c8f554f4d4084526d3e58fef (diff) | |
| download | ngircd-4d152b771e17c23823af995f86912d1550f4c244.tar.gz ngircd-4d152b771e17c23823af995f86912d1550f4c244.zip | |
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.
Diffstat (limited to 'src/testsuite/who-away-test.e')
| -rw-r--r-- | src/testsuite/who-away-test.e | 100 |
1 files changed, 100 insertions, 0 deletions
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- |