-
-
09 Jun 2022 11:19:05 UTC
- Distribution: Test-Time
- Module version: 0.092
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (1)
- Testers (786 / 0 / 0)
- Kwalitee
Bus factor: 1- 90.74% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (52.94KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 8 contributors-
cho45
-
Alexandr Ciornii
-
Gianni Ceccarelli
-
Graham Knop
-
Michael Jemmeson
-
minimalist
-
motemen
-
nanto_vi
- Dependencies
- Test::More
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Test::Time - Overrides the time() and sleep() core functions for testing
SYNOPSIS
use Test::Time; # Freeze time my $now = time(); # Increment internal time (returns immediately) sleep 1; # Return internal time incremented by 1 my $then = time();
DESCRIPTION
Test::Time can be used to test modules that deal with time. Once you
use
this module, all references totime
,localtime
andsleep
will be internalized. You can set custom time by passing time => number after theuse
statement:use Test::Time time => 1; my $now = time; # $now is equal to 1 sleep 300; # returns immediately, displaying a note my $then = time; # $then equals to 301
AUTHOR
cho45 <cho45@lowreal.net>
SEE ALSO
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Test::Time, copy and paste the appropriate command in to your terminal.
cpanm Test::Time
perl -MCPAN -e shell install Test::Time
For more information on module installation, please visit the detailed CPAN module installation guide.