1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!perl
BEGIN { chdir 't' if -d 't' }
use strict;
use warnings;
use Test::More tests => 4;
use Test::NoWarnings;
use Text::MediawikiFormat as => 'wf', prefix => 'rootdir/wiki.pl?page=',
process_html => 0;
my $wikitext =<<WIKI;
StudlyCaps
WIKI
my $htmltext = wf ($wikitext);
unlike $htmltext, qr!<a href='rootdir/wiki\.pl\?page=StudlyCaps'>!m,
'should create links from StudlyCaps if implicit_links is left alone';
$htmltext = wf ($wikitext, {}, {implicit_links => 0});
unlike ($htmltext, qr!<a href='rootdir/wiki\.pl\?page=StudlyCaps'>!m,
'...and if implicit_links set to 0');
$htmltext = wf ($wikitext, {}, {implicit_links => 1});
like ($htmltext, qr!<a href='rootdir/wiki\.pl\?page=StudlyCaps'>!m,
'...and if implicit_links set to 0');
|