Commit | Line | Data |
---|---|---|
8d063cd8 | 1 | #!./perl |
2 | ||
642c4ad7 | 3 | use strict; |
4 | use warnings; | |
5 | use Test::More tests=>4; | |
8d063cd8 | 6 | |
642c4ad7 | 7 | my $start = time; |
8 | my $sleep_says = sleep 3; | |
9 | my $diff = time - $start; | |
8d063cd8 | 10 | |
642c4ad7 | 11 | cmp_ok( $sleep_says, '>=', 2, 'Sleep says it slept at least 2 seconds' ); |
12 | cmp_ok( $sleep_says, '<=', 10, '... and no more than 10' ); | |
13 | ||
14 | cmp_ok( $diff, '>=', 2, 'Actual time diff is at least 2 seconds' ); | |
15 | cmp_ok( $diff, '<=', 10, '... and no more than 10' ); |