use Test::More tests => 100;
isa_ok my $o = Foo->new, 'Foo';
lives_ok { $o->foo(42) } 'can set foo';
is( $o->foo, 42, 'foo set' );
# 95 other tests
lives_ok { $o->bar(42) } 'can set foo';
is( $o->bar, 42, 'foo set' );
####
use Test::More 'no_plan';
{
my $b = Test::Block->expecting(1);
isa_ok my $o = Foo->new, 'Foo';
};
{
my $b = Test::Block->expecting(2);
lives_ok { $o->foo(42) } 'can set foo';
is( $o->foo, 42, 'foo set' );
}
# 95 other tests
{
my $b = Test::Block->expecting(2);
lives_ok { $o->bar(42) } 'can set foo';
is( $o->bar, 42, 'foo set' );
}
####
SKIP: {
ok(1);
skip "skip tests", 2 if $foo;
ok(2);
skip "skip tests", 1 if $bar;
ok(3);
};
####
SKIP: {
my $b = Test::Block->expecting(4);
ok(1);
skip "skip tests", $b->remaining if $foo;
ok(2);
skip "skip tests", $b->remaining if $bar;
ok(3);
ok(4);
};
####
plan tests => @foo + keys %bar + (3*$ni);
####
{
my $b = Test::Block->expecting(scalar(@foo));
# @foo tests
}
{
my $b = Test::Block->expecting(scalar(%bar));
# %bar tests
}
{
my $b = Test::Block->expecting(3 * $ni);
# $ni tests
}