X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsub-quote.t;h=301366ef5aad1d74619f83505089276b8ff196cb;hb=master;hp=c610766029a0c0f479e2ced6a4dbce6a6c7e771d;hpb=a165a07fdceff024146c494a3e3923492a9b3d8d;p=gitmo%2FMoo.git diff --git a/t/sub-quote.t b/t/sub-quote.t index c610766..301366e 100644 --- a/t/sub-quote.t +++ b/t/sub-quote.t @@ -21,8 +21,8 @@ ok(!keys %EVALED, 'Nothing evaled yet'); my $u_one = unquote_sub $one; is_deeply( - [ keys %EVALED ], [ qw(one two) ], - 'Both subs evaled' + [ sort keys %EVALED ], [ qw(one) ], + 'subs one evaled' ); is($one->(), 42, 'One (quoted version)'); @@ -47,4 +47,16 @@ like( 'exception contains correct name' ); +quote_sub 'Foo::four' => q{ + return 5; +}; + +my $quoted = quoted_from_sub(\&Foo::four); +like $quoted->[1], qr/return 5;/, + 'can get quoted from installed sub'; +Foo::four(); +my $quoted2 = quoted_from_sub(\&Foo::four); +is $quoted2->[1], undef, + "can't get quoted from installed sub after undefer"; + done_testing;