/usr/share/doc/perl-Test-Simple/t/Legacy/subtest
#!/usr/bin/perl -w use strict; use Test::Builder; BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ( '../lib', 'lib' ); } else { unshift @INC, 't/lib'; } } use Test::Builder::NoOutput; my $tb = Test::Builder->new; $tb->ok( !eval { $tb->subtest() } ); $tb->like( $@, qr/^\Qsubtest()'s second argument must be a code ref/ ); $tb->ok( !eval { $tb->subtest("foo") } ); $tb->like( $@, qr/^\Qsubtest()'s second argument must be a code ref/ ); my $foo; $tb->subtest('Arg passing', sub { $foo = shift; $tb->ok(1); }, 'foo'); $tb->is_eq($foo, 'foo'); $tb->done_testing();
.
Edit
..
Edit
args.t
Edit
bail_out.t
Edit
basic.t
Edit
callback.t
Edit
die.t
Edit
do.t
Edit
events.t
Edit
for_do_t.test
Edit
fork.t
Edit
implicit_done.t
Edit
line_numbers.t
Edit
plan.t
Edit
predicate.t
Edit
singleton.t
Edit
threads.t
Edit
todo.t
Edit
wstat.t
Edit