summaryrefslogtreecommitdiff
path: root/cpan/Test-Simple/t/Legacy/subtest/args.t
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/Test-Simple/t/Legacy/subtest/args.t')
-rw-r--r--cpan/Test-Simple/t/Legacy/subtest/args.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/cpan/Test-Simple/t/Legacy/subtest/args.t b/cpan/Test-Simple/t/Legacy/subtest/args.t
new file mode 100644
index 0000000000..d43ac5288e
--- /dev/null
+++ b/cpan/Test-Simple/t/Legacy/subtest/args.t
@@ -0,0 +1,34 @@
+#!/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/ );
+
+use Carp qw/confess/;
+$tb->subtest('Arg passing', sub {
+ my $foo = shift;
+ my $child = Test::Builder->new;
+ $child->is_eq($foo, 'foo');
+ $child->done_testing;
+ $child->finalize;
+}, 'foo');
+
+$tb->done_testing();