X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02git_Repository.t;fp=t%2F02git_Repository.t;h=95651430211d3e5758a291509419437004bca161;hb=f444707fbb36619b419eb2aa7a9c297fa5d5534f;hp=ae069eb8126dfac73472fe7054fe0cdfa3e5fe49;hpb=86b3e7ce8d1bb126b7967ec549c010cd707f318c;p=catagits%2FGitalist.git diff --git a/t/02git_Repository.t b/t/02git_Repository.t index ae069eb..9565143 100644 --- a/t/02git_Repository.t +++ b/t/02git_Repository.t @@ -13,14 +13,17 @@ use Test::Exception; use Test::utf8; use Encode qw/decode_utf8/; use Data::Dumper; +use Scalar::Util qw/set_prototype/; BEGIN { # Mocking to allow testing regardless of the user's locale require I18N::Langinfo if $^O ne 'MSWin32'; no warnings 'redefine'; - *I18N::Langinfo::langinfo = sub($) { + my $stub = sub { return "UTF-8" if $_[0] == I18N::Langinfo::CODESET(); }; + set_prototype \&$stub, ($] <= 5.008009) ? '$' : '_'; + *I18N::Langinfo::langinfo = $stub; *CORE::GLOBAL::getpwuid = sub { wantarray ? ("test", "x", "1000", "1000", "", "", "T\x{c3}\x{a9}st", "/home/test", "/bin/bash")