diff options
Diffstat (limited to 't/20attributes.t')
-rw-r--r-- | t/20attributes.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/20attributes.t b/t/20attributes.t new file mode 100644 index 0000000..8491fe5 --- /dev/null +++ b/t/20attributes.t @@ -0,0 +1,27 @@ +#!perl + +BEGIN { + if ($] < 5.014001) { + print "1..0 # SKIP: tests won't pass on less recent perls\n"; + exit; + } +} + +use Test::More tests => 3; +use strict; +use warnings; +use Sub::Identify (); + +sub MODIFY_CODE_ATTRIBUTES { + my ($class, $subref, @attributed) = @_; + is(Sub::Identify::sub_fullname($subref), 'main::foo', 'half compiled'); + return (); +} + +sub foo : MyAttribute {} + +BEGIN { + is(Sub::Identify::sub_fullname(\&foo), 'main::foo', 'full compiled'); +} + +is(Sub::Identify::sub_fullname(\&foo), 'main::foo', 'runtime'); |