--- a/src/test.c Tue Mar 31 20:33:45 2009 +0300
+++ b/src/test.c Tue Mar 31 20:57:07 2009 +0300
@@ -1063,6 +1063,21 @@
irc_net_destroy(net);
}
+void test_irc_chan_privmsg (void)
+{
+ struct test_chan_ctx ctx;
+ struct sock_test *sock = setup_sock_test();
+ struct irc_net *net = setup_irc_net(sock);
+ struct irc_chan *chan = setup_irc_chan(sock, net, "#test", &ctx);
+
+ // rename one of the users
+ log_info("test irc_chan_PRIVMSG");
+ assert_success(irc_chan_PRIVMSG(chan, "foobar quux"));
+ assert_sock_data(sock, "PRIVMSG #test :foobar quux\r\n");
+
+ // cleanup
+ irc_net_destroy(net);
+}
/**
* Test definition
@@ -1092,6 +1107,7 @@
{ "irc_chan_user_nick", &test_irc_chan_user_nick },
{ "irc_chan_user_quit", &test_irc_chan_user_quit },
{ "irc_chan_CTCP_ACTION", &test_irc_chan_CTCP_ACTION },
+ { "irc_chan_privmsg", &test_irc_chan_privmsg },
{ NULL, NULL }
};