File: _runtest.t

package info (click to toggle)
libtest-timer-perl 2.12-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 268 kB
  • sloc: perl: 201; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 653 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
## no critic (RequireVersionVar RequireExplicitPackage RequireEndWithOne)

use warnings;
use strict;
use Test::Fatal;    # like
use Test::More;     # ok

use Test::Timer;

use FindBin qw($Bin);
use lib "$Bin/../t";

use Test::Timer::Test qw(_sleep);

$Test::Timer::alarm = 2;

ok( !Test::Timer::_runtest(), 'testing without parameters' );

ok( !Test::Timer::_runtest( sub { return; }, undef ),
    'testing with single parameters' );

ok( !Test::Timer::_runtest( sub { return; }, 1, undef ),
    'testing with two parameters' );

ok( !Test::Timer::_runtest( sub { return; }, 10, 1 ),
    'testing with two thresholds in wrong order'
);

done_testing();