Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cho45/test-time
https://github.com/cho45/test-time
perl perl5 testing
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cho45/test-time
- Owner: cho45
- License: other
- Created: 2011-06-21T02:28:27.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2022-06-09T11:19:04.000Z (over 2 years ago)
- Last Synced: 2024-06-18T15:23:37.031Z (6 months ago)
- Topics: perl, perl5, testing
- Language: Perl
- Homepage:
- Size: 87.9 KB
- Stars: 3
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
NAME
Test::Time - Overrides the time() and sleep() core functions for testingSYNOPSIS
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 to "time" and "sleep" will be
internalized. You can set custom time by passing time => number after
the "use" 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 301AUTHOR
cho45SEE ALSO
LICENSE
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.