1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
use strict;
use warnings;
use Test::More tests => 1;
{ package Foo;
use Test::More;
use base qw(Test::Class);
sub test_filtered_startup : Test( startup => 1 ) {
fail( "startup test not run, as no normal tests are unfiltered" );
}
sub test_filtered_setup : Test( setup => 1 ) {
fail( "setup test not run, as no normal tests are unfiltered" );
}
sub test_filtered_teardown : Test( teardown => 1 ) {
fail( "teardown test not run, as no normal tests are unfiltered" );
}
sub test_filtered_shutdown : Test( shutdown => 1 ) {
fail( "shutdown test not run, as no normal tests are unfiltered" );
}
sub test_filtered : Test( 1 ) {
fail( "shouldn't run, due to matching filter" );
}
}
Test::Class->add_filter( sub { 0 } );
is( Test::Class->expected_tests, 0, 'setup/teardown not run when no test methods' );
|