Commit | Line | Data |
8d063cd8 |
1 | #!./perl |
2 | |
f9e4a5e8 |
3 | BEGIN { |
4 | chdir 't' if -d 't'; |
5 | @INC = qw(. ../lib); |
6 | } |
7 | |
8 | require "test.pl"; |
9 | plan( tests => 4 ); |
10 | |
642c4ad7 |
11 | use strict; |
12 | use warnings; |
8d063cd8 |
13 | |
642c4ad7 |
14 | my $start = time; |
15 | my $sleep_says = sleep 3; |
16 | my $diff = time - $start; |
8d063cd8 |
17 | |
642c4ad7 |
18 | cmp_ok( $sleep_says, '>=', 2, 'Sleep says it slept at least 2 seconds' ); |
19 | cmp_ok( $sleep_says, '<=', 10, '... and no more than 10' ); |
20 | |
21 | cmp_ok( $diff, '>=', 2, 'Actual time diff is at least 2 seconds' ); |
22 | cmp_ok( $diff, '<=', 10, '... and no more than 10' ); |