1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-19 23:43:05 +02:00
- Fixed bug in `channelMessage(string, string[])` in the case where multiple channels were specified then the message would fail to send to the channels after the first one specified

Unit tests

- Disabled using `command(string, string, string)` to join a  channel, rather use `joinChannel(string)`
- Added tests for singular `channelMessage(string, string[])` and multiple `channelMessage(string, string[])`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-09 08:37:38 +02:00
parent 6f0a9e32ca
commit fe91adde0a

View File

@ -507,6 +507,9 @@ public class Client : Thread
/* Ensure valid characters in first channel */
if(isValidText(channelLine))
{
/* Append on a trailing `,` */
channelLine ~= ",";
for(ulong i = 1; i < channels.length; i++)
{
string currentChannel = channels[i];
@ -1177,7 +1180,10 @@ public class Client : Thread
client.command(new Message("", "USER", "doggie doggie irc.frdeenode.net :Tristan B. Kildaire"));
Thread.sleep(dur!("seconds")(4));
client.command(new Message("", "JOIN", "#birchwood"));
// client.command(new Message("", "JOIN", "#birchwood"));
client.joinChannel("#birchwood");
// TODO: Add a joinChannels(string[])
client.joinChannel("#birchwood2");
Thread.sleep(dur!("seconds")(2));
client.command(new Message("", "NAMES", ""));
@ -1188,6 +1194,17 @@ public class Client : Thread
Thread.sleep(dur!("seconds")(2));
client.command(new Message("", "PRIVMSG", "deavmi naai"));
/**
* Test sending a message to a channel
*/
client.channelMessage("This is a test message sent to a channel", ["#birchwood"]);
/**
* Test sending a message to multiple channels
*/
client.channelMessage("This is a message sent to multiple channels one-shot", ["#birchwood", "#birchwood2"]);
/* TODO: Add a check here to make sure the above worked I guess? */
/* TODO: Make this end */
// while(true)