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