From: Graham Knop Date: Thu, 29 Sep 2016 18:44:13 +0000 (-0400) Subject: test native exotic sub names by aliasing globs X-Git-Tag: v0.22~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63be23c8914e4741b2e25607a65fb77db9092edd;p=p5sagit%2FSub-Name.git test native exotic sub names by aliasing globs --- diff --git a/t/exotic_names.t b/t/exotic_names.t index eb7c4a6..621cad6 100644 --- a/t/exotic_names.t +++ b/t/exotic_names.t @@ -99,9 +99,16 @@ 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}:: + ${"palatable::$subname"} = 1; + ${"palatable::"}{"sub"} = ${"palatable::"}{$subname}; + # 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; }