/tags/3.1/t/43_expandtemplates.t
http://perlwikipedia.googlecode.com/ · Raku · 24 lines · 12 code · 8 blank · 4 comment · 0 complexity · 3eaf226da457bb9972010bb76cf36d42 MD5 · raw file
- # Before `make install' is performed this script should be runnable with
- # `make test'. After `make install' it should work as `perl MediaWiki::Bot.t'
- #########################
- use strict;
- use warnings;
- use Test::More tests => 2;
- #########################
- use MediaWiki::Bot;
- my $bot = MediaWiki::Bot->new({
- agent => 'MediaWiki::Bot tests (43_expandtemplates.t)',
- });
- my $text = '<tt><nowiki>{{</nowiki>[[Template:tlx|tlx]]<nowiki>}}</nowiki></tt>';
- is($bot->expandtemplates(undef, '{{tlx|tlx}}'), $text, '[[Template:Tlx]] expanded OK');
- my $main_page = $bot->get_text('Main Page');
- my $expanded = $bot->expandtemplates('Main Page');
- isnt($main_page, $expanded, 'Wikitext != expanded text');