mirror of
https://github.com/osmarks/ngircd.git
synced 2025-12-05 14:08:06 +00:00
The students in my software-engineering class are writing IRC clients in
Java, and I'm running ngIRCd as a sandbox for them to play in. We
noticed ngIRCd doesn't obey the "JOIN 0" command specified in RFC 2812:
JOIN 0 ; Leave all currently joined
channels.
http://tools.ietf.org/html/rfc2812#section-3.2.1
I believe the following patch addresses this. Cheers!
[fw@strlen.de: put it into a seperate function]
109 lines
1.4 KiB
Plaintext
109 lines
1.4 KiB
Plaintext
# $Id: channel-test.e,v 1.4 2008/02/05 13:31:51 fw Exp $
|
|
|
|
spawn telnet localhost 6789
|
|
expect {
|
|
timeout { exit 1 }
|
|
"Connected"
|
|
}
|
|
|
|
send "nick nick\r"
|
|
send "user user . . :User\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"376"
|
|
}
|
|
|
|
send "join #channel\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* JOIN :#channel"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"366"
|
|
}
|
|
|
|
send "topic #channel :Test-Topic\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* TOPIC #channel :Test-Topic"
|
|
}
|
|
|
|
send "who #channel\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"352 nick #channel"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"* nick H@ :0 User"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"315 nick #channel"
|
|
}
|
|
|
|
send "names #channel\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"353 nick = #channel :@nick"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"366 nick #channel"
|
|
}
|
|
|
|
send "list\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"322 nick #channel 1 :Test-Topic"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"323 nick :End of LIST"
|
|
}
|
|
|
|
send "part #channel\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* PART #channel :nick"
|
|
}
|
|
|
|
send "join #channel\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* JOIN :#channel"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"366"
|
|
}
|
|
|
|
send "join #channel2\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* JOIN :#channel2"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"366"
|
|
}
|
|
|
|
send "join 0\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* PART #channel2 :nick"
|
|
}
|
|
expect {
|
|
timeout { exit 1 }
|
|
"@* PART #channel :nick"
|
|
}
|
|
|
|
send "quit\r"
|
|
expect {
|
|
timeout { exit 1 }
|
|
"Connection closed"
|
|
}
|
|
|
|
# -eof-
|