]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Tests for the INVITE command.
authorDana Dahlstrom <dana+ngIRCd@cs.ucsd.edu>
Sun, 4 May 2008 03:02:12 +0000 (20:02 -0700)
committerFlorian Westphal <fw@strlen.de>
Mon, 5 May 2008 14:12:41 +0000 (16:12 +0200)
src/testsuite/invite-test.e [new file with mode: 0644]

diff --git a/src/testsuite/invite-test.e b/src/testsuite/invite-test.e
new file mode 100644 (file)
index 0000000..17afbd2
--- /dev/null
@@ -0,0 +1,113 @@
+spawn telnet localhost 6789
+expect {
+       timeout { exit 1 }
+       "Connected"
+}
+
+send "nick nick\r"
+send "user user . . :User\r"
+expect {
+       timeout { exit 1 }
+       "376"
+}
+
+send "invite\r"
+expect {
+       timeout { exit 1 }
+       "461"
+}
+
+send "invite nick\r"
+expect {
+       timeout { exit 1 }
+       "461"
+}
+
+send "invite nick #channel\r"
+expect {
+       timeout { exit 1 }
+       -re "INVITE nick :?#channel"
+}
+expect {
+       timeout { exit 1 }
+       -re "341 nick nick :?#channel"
+}
+
+send "invite nosuchnic #TopicChannel\r"
+expect {
+       timeout { exit 1 }
+       "401 nick nosuchnic :No such nick or channel name"
+}
+
+send "invite nick #TopicChannel\r"
+expect {
+       timeout { exit 1 }
+       "442 nick #TopicChannel :You are not on that channel"
+}
+
+send "join #channel\r"
+expect {
+       timeout { exit 1 }
+       -re "JOIN :?#channel"
+}
+
+send "invite nick #channel\r"
+expect {
+       timeout { exit 1 }
+       "443 nick nick #channel :is already on channel"
+}
+
+send "mode #channel +i\r"
+expect {
+       timeout { exit 1 }
+       "MODE #channel +i"
+}
+
+send "mode #channel -o nick\r"
+expect {
+       timeout { exit 1 }
+       "MODE #channel -o nick"
+}
+
+send "invite nick #channel\r"
+expect {
+       timeout { exit 1 }
+       "482 nick #channel :You are not channel operator"
+       # it would be reasonable to expect 443 here instead
+}
+
+send "part #channel\r"
+expect {
+       timeout { exit 1}
+       -re "PART #channel :?nick"
+}
+
+send "invite nick :parameter with spaces\r"
+expect {
+       timeout { exit 1 }
+       "INVITE nick :parameter with spaces"
+}
+expect {
+       timeout { exit 1 }
+       "341 nick nick :parameter with spaces"
+}
+
+send "away message\r"
+expect {
+       timeout { exit 1 }
+       "306 nick :You have been marked as being away"
+}
+
+send "INVITE nick #channel\r"
+expect {
+       timeout { exit 1 }
+       -re "301 nick nick :?message"
+}
+
+send "quit\r"
+expect {
+       timeout { exit 1 }
+       "Connection closed"
+}
+
+# -eof-