1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-03-28 11:46:55 +00:00
ngircd/src/testsuite/who-away-test.e
Florian Westphal 4d152b771e 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.
2008-02-26 23:49:33 +01:00

101 lines
1.9 KiB
Plaintext

# $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-