t/plugin.t
raw| 1 | #!perl -T |
| 2 | use Test::Simple tests => 1; |
| 3 | use Text::WikiCreole; |
| 4 | |
| 5 | # test user-supplied plugin function |
| 6 | |
| 7 | $markup = qq|This is a paragraph with an uppercasing << plugin >>. |
| 8 | Check it out.|; |
| 9 | |
| 10 | $goodhtml = qq|<p>This is a paragraph with an uppercasing PLUGIN . |
| 11 | Check it out.</p> |
| 12 | |
| 13 | |; |
| 14 | |
| 15 | sub uppercase { |
| 16 | $_[0] =~ s/([a-z])/\u$1/gso; |
| 17 | return $_[0]; |
| 18 | } |
| 19 | |
| 20 | creole_plugin(\&uppercase); |
| 21 | $html = creole_parse $markup; |
| 22 | |
| 23 | ok( $html eq $goodhtml ); |
| 24 |