Subject: | Testing anonymout subs? |
Hi,
I have been trying to test anonymous subs:
use Test::More tests => 1;
use Test::Output;
# Use anonymous subs.
my $writer = sub { print 'STDOUT', ' '; print STDERR 'STDERR' };
combined_is( $writer, 'STDOUT STDERR', 'Test combined output' );
Under "This is perl, v5.8.4 built for i386-linux-thread-multi" I get:
Show quoted text
> Type of arg 1 to Test::Output::combined_is must be block or sub {}
> (not private variable) at test_output.t line 9, near "'Test combined output' )"
This is quite understandable from the the function prototype, however I would be nice if one wouldn't have to worry about that.
CU, Bernhard