use Test::More tests => 8; use MojoMojo::Formatter::IRCLog; my $content; my $ib = "\n=irc\n"; my $ie = "\n=irc\n"; my $ob = "\n==\n
\n"; my $oe = "
\n==\n"; $content = "${ib} text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "basic"); $content = "${ib}12:00 text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "with timestamp"); $content = "${ib}12:00 < nick> text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "with space"); $content = "${ib}12:00 <\@nick> text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "op"); $content = "${ib}12:00 <%nick> text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "half-op"); $content = "${ib}12:00 <+nick> text$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text
\n$oe", "voice"); $content = "${ib}12:00 <+nick> text\nmore$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text more
\n$oe", "multi-line"); $content = "${ib}12:00 <+nick> text\nmore$ie${ib}12:00 <+nick> text\nmore$ie"; MojoMojo::Formatter::IRCLog->format_content(\$content); is($content, "$ob
[[nick]]
\n
text more
\n$oe$ob
[[nick]]
\n
text more
\n$oe", "multi-block");