]> git.ipfire.org Git - thirdparty/git.git/blobdiff - contrib/mw-to-git/t/test-gitmw.pl
remote-mediawiki tests: replace deprecated Perl construct
[thirdparty/git.git] / contrib / mw-to-git / t / test-gitmw.pl
index 0ff76259faa6854345203bd3fbcdb738b789bff1..71e5b06235dfd1455878bf5168c8eab1c0799ad4 100755 (executable)
@@ -24,7 +24,6 @@
 
 use MediaWiki::API;
 use Getopt::Long;
-use encoding 'utf8';
 use DateTime::Format::ISO8601;
 use open ':encoding(utf8)';
 use constant SLASH_REPLACEMENT => "%2F";
@@ -214,12 +213,12 @@ my $fct_to_call = shift;
 
 wiki_login($wiki_admin, $wiki_admin_pass);
 
-my %functions_to_call = qw(
-       upload_file    wiki_upload_file
-       get_page       wiki_getpage
-       delete_page    wiki_delete_page
-       edit_page      wiki_editpage
-       getallpagename wiki_getallpagename
+my %functions_to_call = (
+       upload_file    => \&wiki_upload_file,
+       get_page       => \&wiki_getpage,
+       delete_page    => \&wiki_delete_page,
+       edit_page      => \&wiki_editpage,
+       getallpagename => \&wiki_getallpagename,
 );
 die "$0 ERROR: wrong argument" unless exists $functions_to_call{$fct_to_call};
-&{$functions_to_call{$fct_to_call}}(@ARGV);
+$functions_to_call{$fct_to_call}->(map { utf8::decode($_); $_ } @ARGV);