root/Text-Emoticon-MSN/trunk/t/01_emoticon.t

Revision 1526 (checked in by miyagawa, 15 years ago)

import

  • Property svn:keywords set to Id Revision
Line 
1 use strict;
2 use Test::More;
3
4 use Text::Emoticon::MSN;
5
6 my $text = "blah ;-)blah (o)";
7
8 my @Tests = (
9     # args, filtered_text
10     [ { },
11       qq(blah <img src="./wink_smile.gif" />blah <img src="./clock.gif" />) ],
12     [ { imgbase => "http://example.com/img" },
13       qq(blah <img src="http://example.com/img/wink_smile.gif" />blah <img src="http://example.com/img/clock.gif" />) ],
14     [ { xhtml => 0 },
15       qq(blah <img src="./wink_smile.gif">blah <img src="./clock.gif">) ],
16     [ { class => "emo" },
17       qq(blah <img src="./wink_smile.gif" class="emo" />blah <img src="./clock.gif" class="emo" />) ],
18 );
19
20 plan tests => scalar(@Tests);
21
22 for (@Tests) {
23     my($args, $filtered) = @$_;
24     my $emoticon = Text::Emoticon::MSN->new(%$args);
25     is $emoticon->filter($text), $filtered;
26 }
Note: See TracBrowser for help on using the browser.