Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the delorean Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 04:25:53 2022 GMT+0.
Next: Systems, Previous: The delorean Reference Manual, Up: The delorean Reference Manual [Contents][Index]
A simple set of macros for mocking time
(deftest delorean ()
(let ((point-in-time (local-time:now)))
(with-frozen-clock point-in-time
(sleep 2)
(is (local-time:timestamp= (local-time:now) point-in-time))))
(let ((same-time-tomorrow (local-time:timestamp+ (local-time:now) 1 :day)))
(with-shifted-clock same-time-tomorrow
(sleep 2)
(is (local-time:timestamp= (local-time:now)
(local-time:timestamp-minimize-part
(local-time:timestamp+ same-time-tomorrow 2 :sec) :nsec)))))
(let ((now (local-time:now)))
(with-scaled-clock 2
(sleep 2)
(is (local-time:timestamp= (local-time:now)
(local-time:timestamp-minimize-part
(local-time:timestamp+ now 4 :sec) :nsec))))))
The respective clocks can be nested arbitrarily inside one-another.
Development of delorean is hosted on github at https://github.com/cddr/delorean.
To my knowledge, there is currently 1 user (i.e. me) so I'm just hacking directly on master. If you start to find it useful, let me know and we can formalize the release process a little but I don't foresee lots of changes. It's a pretty simple solution to a small problem.
Check out the Makefile for the details of how to build and test the software. It's shamelessly copied from cffi (Luís Oliveira is awesome). It also includes a target to build documentation using atdoc (David Lichteblau is also awesome).
What bugs? No really, if you find a bug, let me know by raising a github issue.
Next: Files, Previous: Introduction, Up: The delorean Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Delorean is a time machine for unit tests
Andy Chambers
local-time (system).
delorean.lisp (file).
Next: Packages, Previous: Systems, Up: The delorean Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: delorean/delorean.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
delorean (system).
Previous: delorean/delorean.asd, Up: Lisp [Contents][Index]
delorean (system).
Next: Definitions, Previous: Files, Up: The delorean Reference Manual [Contents][Index]
Packages are listed by definition order.
A set of macros loosely based on travisjeffery’s timecop
library with the purpose of making it easier to test time-sensitive code
common-lisp.
Next: Indexes, Previous: Packages, Up: The delorean Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Standalone methods, Previous: Public Interface, Up: Public Interface [Contents][Index]
Freezes the notion of local-time’s ‘now’ function
Within body (and any code called by body), calling (now) will always return ‘time’
Accelerates (or decelarates) time by a factor indicated by ‘scale’
Teleports to the time indicated by ‘to’ before executing ‘body’
Next: Classes, Previous: Macros, Up: Public Interface [Contents][Index]
local-time.
local-time.
local-time.
Previous: Standalone methods, Up: Public Interface [Contents][Index]
A clock which allows time to be frozen in perpetuity
:frozen-time
A clock which allows time to proceed faster or slower than normal
:scale
A clock which allows time to be shifted to the specified time
:shifted-time
Previous: Public Interface, Up: Definitions [Contents][Index]
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Previous: Generic functions, Up: Internals [Contents][Index]
The base class that is extended by all mock clocks
Previous: Definitions, Up: The delorean Reference Manual [Contents][Index]
Jump to: | (
C F G M P S W |
---|
Jump to: | (
C F G M P S W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|
Jump to: | C D F M P S |
---|
Jump to: | C D F M P S |
---|