--- demerphq <[EMAIL PROTECTED]> wrote:
> One idea might be to try using Data::Dump::Streamer for your tests.
> It
> will serialize the lexical context that the subroutine was compiled
> with (including bound anonymous subroutines and their lexical
> context).
>
> A small hack (that i would be ha
On 8/11/05, Ovid <[EMAIL PROTECTED]> wrote:
> X-Posted to Perlmonks (http://perlmonks.org/index.pl?node_id=483100)
>
> I frequently write code that generates anonymous functions on the fly.
> However, I often want to verify that these functions are correct
> without executing them. To this end, I
* David Golden <[EMAIL PROTECTED]> [2005-08-12T09:10:21]
> Won't "&is_code" get called that way? Should this be:
>
> ok defined \&is_code;
No. C will do the right thing, here. Taking a reference to an
undefined sub, however, will always return a defined value: a coderef
that, when called,
Ivan Tubert-Brohman wrote:
Isn't
ok defined *::is_code{CODE};
just a convoluted way of saying
ok defined &is_code;
Won't "&is_code" get called that way? Should this be:
ok defined \&is_code;
David Golden
Ovid wrote:
X-Posted to Perlmonks (http://perlmonks.org/index.pl?node_id=483100)
I frequently write code that generates anonymous functions on the fly.
However, I often want to verify that these functions are correct
without executing them. To this end, I've started writing Test::Code.
Here'
--- Ivan Tubert-Brohman <[EMAIL PROTECTED]> wrote:
> Isn't
>
>ok defined *::is_code{CODE};
>
> just a convoluted way of saying
>
>ok defined &is_code;
Er, yes. It is. That's just a really bad habit on my part. I do a
fair amount of typeglob diddling, so that tends to stick in my min
Michael G Schwern wrote:
On Thu, Aug 11, 2005 at 02:49:57PM -0700, Ovid wrote:
BEGIN { use_ok 'Test::Code' or die }
ok defined *::is_code{CODE},
'&is_code should be exported to our namespace';
I usually do this with can_ok()
can_ok( __PACKAGE__, qw(is_code isnt_code) );
Isn'
--- Michael G Schwern <[EMAIL PROTECTED]> wrote:
> > ok defined *::is_code{CODE},
> > '&is_code should be exported to our namespace';
>
> I usually do this with can_ok()
>
> can_ok( __PACKAGE__, qw(is_code isnt_code) );
I specifically avoid that with methods because &can_ok provides
On Thu, Aug 11, 2005 at 02:49:57PM -0700, Ovid wrote:
> BEGIN { use_ok 'Test::Code' or die }
>
> ok defined *::is_code{CODE},
> '&is_code should be exported to our namespace';
I usually do this with can_ok()
can_ok( __PACKAGE__, qw(is_code isnt_code) );
> is_code sub { 1 }, s