File: RunByLine.t

package info (click to toggle)
libfennec-lite-perl 0.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 96 kB
  • sloc: perl: 439; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 749 bytes parent folder | download | duplicates (4)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
use strict;
use warnings;

# Use plan instead of done testing so we pass on old versions
use Fennec::Lite plan => 2;

my $ran;

tests "item_blah" => sub {
    $ran++
};

tests "item_by_line" => sub {
    $ran = "correct";
};

tests "item_extra" => sub {
    $ran++
};

{
    local $ENV{FENNEC_ITEM} = 15;
    run_tests();
    is( $ran, "correct", "Only ran 1" );
}

$ran = undef;
my $fennec = Fennec::Lite->new( test_class => __PACKAGE__ );

$fennec->add_tests( "item_blah" => sub {
    $ran++
});

$fennec->add_tests( "item_by_line" => sub {
    $ran = "correct";
});

$fennec->add_tests( "item_extra" => sub {
    $ran++
});

{
    local $ENV{FENNEC_ITEM} = 36;
    $fennec->run_tests();
    is( $ran, "correct", "Only ran 1" );
}