]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/testsuite/channel-test.e
Test suite: Correctly test for LOGNAME and USER
[ngircd-alex.git] / src / testsuite / channel-test.e
index ce14613c5f46bcce34a689544c68d9a8153f6cc4..5e0afab3ac9621b446ac25210c9cf66822c18555 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: channel-test.e,v 1.1 2002/09/09 10:16:24 alex Exp $
+# ngIRCd test suite
+# Channel test
 
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
 expect {
        timeout { exit 1 }
        "Connected"
@@ -16,23 +17,91 @@ expect {
 send "join #channel\r"
 expect {
        timeout { exit 1 }
-       ":nick!~user@* JOIN :#channel"
+       "@* JOIN :#channel"
 }
 expect {
        timeout { exit 1 }
        "366"
 }
 
-send "part #channel\r"
+send "topic #channel :Test-Topic\r"
 expect {
        timeout { exit 1 }
-       ":nick!~user@* PART #channel :nick"
+       "@* TOPIC #channel :Test-Topic"
 }
 
-send "quit\r"
+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 }
-       "Connection closed"
+       "366 nick #channel"
 }
 
-# -eof-
+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 :bye bye\r"
+expect {
+       timeout { exit 1 }
+       "@* PART #channel :bye bye"
+}
+
+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 :"
+}
+expect {
+       timeout { exit 1 }
+       "@* PART #channel :"
+}
+
+send "quit\r"
+expect {
+       timeout { exit 1 }
+       "ERROR :Closing connection"
+}