File: filter_multiple.t

package info (click to toggle)
libtest-class-perl 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 540 kB
  • sloc: perl: 1,706; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 751 bytes parent folder | download
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
33
use strict;
use warnings;

package Foo;
use Test::More;
use base qw(Test::Class);

sub test_not_filtered : Test(1) {
    pass( "test_not_filtered doesn't meet any filters, so is run" );
}

sub test_filter_me : Test(1) {
    fail( "shouldn't run, due to filtering of /filter_me/" );
}

sub test_me_too : Test(1) {
    fail( "shouldn't run, due to filtering of /me_too/" );
}

sub test_filter_me_as_well : Test(1) {
    fail( "shouldn't run, due to filtering of /filter_me/" );
}

sub test_another_not_matching : Test(1) {
    pass( "test_another_not_matching doesn't meet any filters, so is run" );
}

package main;

Test::Class->add_filter( sub { $_[1] !~ /filter_me/ } );
Test::Class->add_filter( sub { $_[1] !~ /me_too/ } );

Test::Class->runtests;