summary refs log tree commit diff
path: root/src/testsuite
diff options
context:
space:
mode:
authorDana Dahlstrom <dana@cs.ucsd.edu>2008-02-05 13:31:50 +0000
committerFlorian Westphal <fw@strlen.de>2008-02-26 23:49:33 +0100
commit6bd35bf090694a77b4a6c13c8fe5bb52e5905ec1 (patch)
tree3bc591dbaba2d169050a1e8bb79f9f2f0a71f91d /src/testsuite
parent3022d7cff35118b6651c1165227aa79d759d9bfd (diff)
downloadngircd-6bd35bf090694a77b4a6c13c8fe5bb52e5905ec1.tar.gz
ngircd-6bd35bf090694a77b4a6c13c8fe5bb52e5905ec1.zip
Implement RFC 2812 handling of "0" argument to JOIN
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]
Diffstat (limited to 'src/testsuite')
-rw-r--r--src/testsuite/channel-test.e32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/testsuite/channel-test.e b/src/testsuite/channel-test.e
index 240abf64..16c67ad4 100644
--- a/src/testsuite/channel-test.e
+++ b/src/testsuite/channel-test.e
@@ -1,4 +1,4 @@
-# $Id: channel-test.e,v 1.3 2003/12/27 13:01:12 alex Exp $
+# $Id: channel-test.e,v 1.4 2008/02/05 13:31:51 fw Exp $
 
 spawn telnet localhost 6789
 expect {
@@ -69,6 +69,36 @@ expect {
 	"@* 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 }