Initial commit
[poe-component-irc-plugin-logger-irssi.git] / t / POE-Component-IRC-Plugin-Logger-Irssi.t
CommitLineData
e628c597
MG
1use v5.14;
2use strict;
3use warnings;
4
5use Test::More tests => 14;
6BEGIN { use_ok('POE::Component::IRC::Plugin::Logger::Irssi', 'irssi_format') };
7
8my $fmt = irssi_format;
9my $localtime0 = localtime 0;
10is $fmt->{'+b'}->('mgv', '*!root@*'), '-!- mode [+b *!root@*] by mgv', 'mode +b';
11is $fmt->{nick_change}->('mgv', 'arachnidsGrip'), '-!- mgv is now known as arachnidsGrip', 'change nick';
12is $fmt->{topic_is}->('#chan', 'wasting time'), '-!- Topic for #chan: wasting time', 'see topic';
13is $fmt->{topic_change}->('mgv', 'doing nothing'), '-!- mgv changed the topic to: doing nothing', 'set topic';
14is $fmt->{topic_change}->('mgv', ''), '-!- Topic unset by mgv', 'unset topic';
15is $fmt->{privmsg}->('mgv', 'Hello, world!'), '<mgv> Hello, world!', 'privmsg';
16is $fmt->{notice}->('mgv', 'Hello, world!'), '-mgv- Hello, world!', 'notice';
17is $fmt->{action}->('mgv', 'says hello'), '* mgv says hello', 'action';
18is $fmt->{join}->('mgv', 'marius@example.org', '#chan'), '-!- mgv [marius@example.org] has joined #chan', 'join';
19is $fmt->{part}->('mgv', 'marius@example.org', '#chan', 'bye'), '-!- mgv [marius@example.org] has left #chan [bye]', 'part';
20is $fmt->{quit}->('mgv', 'marius@example.org', 'buh-bye'), '-!- mgv [marius@example.org] has quit [buh-bye]', 'quit';
21is $fmt->{kick}->('mgv', 'troll', '#chan', 'trolling'), '-!- troll was kicked from #chan by mgv [trolling]', 'kick';
22is $fmt->{topic_set_by}->('#chan', 'mgv', 0), "-!- Topic set by mgv [$localtime0]";
23
This page took 0.009558 seconds and 4 git commands to generate.