This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get t/uni/cache.t working under minitest
[perl5.git] / t / op / sleep.t
CommitLineData
8d063cd8
LW
1#!./perl
2
f9e4a5e8
SP
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = qw(. ../lib);
6}
7
8require "test.pl";
9plan( tests => 4 );
10
642c4ad7
AL
11use strict;
12use warnings;
8d063cd8 13
642c4ad7
AL
14my $start = time;
15my $sleep_says = sleep 3;
16my $diff = time - $start;
8d063cd8 17
642c4ad7
AL
18cmp_ok( $sleep_says, '>=', 2, 'Sleep says it slept at least 2 seconds' );
19cmp_ok( $sleep_says, '<=', 10, '... and no more than 10' );
20
21cmp_ok( $diff, '>=', 2, 'Actual time diff is at least 2 seconds' );
22cmp_ok( $diff, '<=', 10, '... and no more than 10' );