Source

perl-App-Countdown / App-Countdown / t / unit-calc-delay.t

Full commit
Shlomi Fish 3bbaf8f 




Shlomi Fish 90e7da4 
Shlomi Fish 3bbaf8f 







Shlomi Fish 1e28e99 


Shlomi Fish 261db5a 


Shlomi Fish 4438d65 


Shlomi Fish 90e7da4 


Shlomi Fish 3bbaf8f 
#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 5;

use App::Countdown;

{
    my $obj = App::Countdown->new({argv => [1]});

    # TEST
    is ($obj->_calc_delay('1'), 1, "_calc_delay(1) == 1");

    # TEST
    is ($obj->_calc_delay('60'), 60, "_calc_delay(60) == 60");

    # TEST
    is ($obj->_calc_delay('2m'), 120, "_calc_delay(2m) == 120 (2 minutes)");

    # TEST
    is ($obj->_calc_delay('1m'), 60, "_calc_delay(1m) == 60 (1 minute)");

    # TEST
    is ($obj->_calc_delay('1h'), 60*60, "_calc_delay(1h) == 60*60 (1 hour)");
}