From: Vincent Pit Date: Mon, 4 Aug 2008 23:08:44 +0000 (+0200) Subject: Also add support for stat X-Git-Tag: v0.02~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=24a8dd6910b767ae90c3577ba31458dda30888e5;p=perl%2Fmodules%2FSub-Nary.git Also add support for stat --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 861f9e5..d1c1dda 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -204,6 +204,7 @@ $ops{$_} = 1 for qw/padsv/; $ops{$_} = 'list' for qw/padav/; $ops{$_} = 'list' for qw/padhv rv2hv/; $ops{$_} = 'list' for qw/padany flip match entereval readline/; +$ops{stat} = 13; $ops{caller} = sub { my @a = caller 0; scalar @a }->(); $ops{localtime} = do { my @a = localtime; scalar @a }; diff --git a/t/20-return.t b/t/20-return.t index 087813e..7ba7a74 100644 --- a/t/20-return.t +++ b/t/20-return.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 51; +use Test::More tests => 52; use Sub::Nary; @@ -73,6 +73,7 @@ my @tests = ( [ sub { return <$x> }, 'list' ], + [ sub { return stat $0 }, 13 ], [ sub { return caller 0 }, sub { my @a = caller 0; scalar @a }->() ], [ sub { return localtime }, do { my @a = localtime; scalar @a } ], ); diff --git a/t/21-list.t b/t/21-list.t index a9b1fdd..56c06f3 100644 --- a/t/21-list.t +++ b/t/21-list.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 37; +use Test::More tests => 38; use Sub::Nary; @@ -61,6 +61,7 @@ my @tests = ( [ sub { <$x> }, 'list' ], + [ sub { stat $0 }, 13 ], [ sub { caller 0 }, sub { my @a = caller 0; scalar @a }->() ], [ sub { localtime }, do { my @a = localtime; scalar @a } ], );