X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fexotic_names.t;h=6a5e28e2c5c1a04785f6b121016c6391517a1ee2;hb=a24a624977b29cacd9a9afdc7644395be55ebcb5;hp=eb7c4a6cf0d142aeebf319a3f588c1b566dd4b90;hpb=67415d50e56340a222b0ceaedb48fe0bea2730a8;p=p5sagit%2FSub-Name.git diff --git a/t/exotic_names.t b/t/exotic_names.t index eb7c4a6..6a5e28e 100644 --- a/t/exotic_names.t +++ b/t/exotic_names.t @@ -99,9 +99,18 @@ for my $ord (@ordinal) { $sub = compile_named_sub $expected => '(caller(0))[3]'; } else { # not a legal identifier but at least test the package name by aliasing - $expected = "${pkg}::foo"; - { no strict 'refs'; *palatable:: = *{"${pkg}::"} } # now palatable:: literally means ${pkg}:: - $sub = compile_named_sub 'palatable::foo' => '(caller(0))[3]'; + $expected = "aliased::native::$fullname"; + { + no strict 'refs'; + *palatable:: = *{"aliased::native::${pkg}::"}; + # now palatable:: literally means aliased::native::${pkg}:: + my $encoded_sub = $subname; + utf8::encode($encoded_sub) if "$]" < 5.016 and $ord > 255; + ${"palatable::$encoded_sub"} = 1; + ${"palatable::"}{"sub"} = ${"palatable::"}{$encoded_sub}; + # and palatable::sub means aliased::native::${pkg}::${subname} + } + $sub = compile_named_sub 'palatable::sub' => '(caller(0))[3]'; } caller3_ok $sub, $expected, 'natively compiled sub', $ord; }