/tags/3.1/t/43_expandtemplates.t
Unknown | 24 lines | 16 code | 8 blank | 0 comment | 0 complexity | 3eaf226da457bb9972010bb76cf36d42 MD5 | raw file
Possible License(s): GPL-3.0
1# Before `make install' is performed this script should be runnable with 2# `make test'. After `make install' it should work as `perl MediaWiki::Bot.t' 3 4######################### 5 6use strict; 7use warnings; 8use Test::More tests => 2; 9 10######################### 11 12use MediaWiki::Bot; 13 14my $bot = MediaWiki::Bot->new({ 15 agent => 'MediaWiki::Bot tests (43_expandtemplates.t)', 16}); 17 18my $text = '<tt><nowiki>{{</nowiki>[[Template:tlx|tlx]]<nowiki>}}</nowiki></tt>'; 19is($bot->expandtemplates(undef, '{{tlx|tlx}}'), $text, '[[Template:Tlx]] expanded OK'); 20 21my $main_page = $bot->get_text('Main Page'); 22my $expanded = $bot->expandtemplates('Main Page'); 23isnt($main_page, $expanded, 'Wikitext != expanded text'); 24