The delorean Reference Manual

This is the delorean Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:01:37 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 delorean

Delorean is a time machine for unit tests

Author

Andy Chambers

Dependency

local-time (system).

Source

delorean.asd.

Child Component

delorean.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 delorean/delorean.asd

Source

delorean.asd.

Parent Component

delorean (system).

ASDF Systems

delorean.


3.1.2 delorean/delorean.lisp

Source

delorean.asd.

Parent Component

delorean (system).

Packages

delorean.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 delorean

A set of macros loosely based on travisjeffery’s timecop
library with the purpose of making it easier to test time-sensitive code

Source

delorean.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: with-frozen-clock (time &body body)

Freezes the notion of local-time’s ‘now’ function

Within body (and any code called by body), calling (now) will always return ‘time’

Package

delorean.

Source

delorean.lisp.

Macro: with-scaled-clock (scale &body body)

Accelerates (or decelarates) time by a factor indicated by ‘scale’

Package

delorean.

Source

delorean.lisp.

Macro: with-shifted-clock (to &body body)

Teleports to the time indicated by ‘to’ before executing ‘body’

Package

delorean.

Source

delorean.lisp.


5.1.2 Standalone methods

Method: clock-now ((self frozen-clock))
Package

local-time.

Source

delorean.lisp.

Method: clock-now ((self shifted-clock))
Package

local-time.

Source

delorean.lisp.

Method: clock-now ((self scaled-clock))
Package

local-time.

Source

delorean.lisp.


5.1.3 Classes

Class: frozen-clock

A clock which allows time to be frozen in perpetuity

Package

delorean.

Source

delorean.lisp.

Direct superclasses

mock-clock.

Direct methods
Direct slots
Slot: frozen-time
Initargs

:frozen-time

Readers

frozen-time.

Writers

(setf frozen-time).

Class: scaled-clock

A clock which allows time to proceed faster or slower than normal

Package

delorean.

Source

delorean.lisp.

Direct superclasses

mock-clock.

Direct methods
Direct slots
Slot: scale
Initargs

:scale

Readers

scale.

Writers

(setf scale).

Class: shifted-clock

A clock which allows time to be shifted to the specified time

Package

delorean.

Source

delorean.lisp.

Direct superclasses

mock-clock.

Direct methods
Direct slots
Slot: shifted-time
Initargs

:shifted-time

Readers

shifted-time.

Writers

(setf shifted-time).


5.2 Internals


5.2.1 Generic functions

Generic Reader: created-at (object)
Package

delorean.

Methods
Reader Method: created-at ((mock-clock mock-clock))

automatically generated reader method

Source

delorean.lisp.

Target Slot

created-at.

Generic Writer: (setf created-at) (object)
Package

delorean.

Methods
Writer Method: (setf created-at) ((mock-clock mock-clock))

automatically generated writer method

Source

delorean.lisp.

Target Slot

created-at.

Generic Reader: frozen-time (object)
Package

delorean.

Methods
Reader Method: frozen-time ((frozen-clock frozen-clock))

automatically generated reader method

Source

delorean.lisp.

Target Slot

frozen-time.

Generic Writer: (setf frozen-time) (object)
Package

delorean.

Methods
Writer Method: (setf frozen-time) ((frozen-clock frozen-clock))

automatically generated writer method

Source

delorean.lisp.

Target Slot

frozen-time.

Generic Reader: parent-clock (object)
Package

delorean.

Methods
Reader Method: parent-clock ((mock-clock mock-clock))

automatically generated reader method

Source

delorean.lisp.

Target Slot

parent-clock.

Generic Writer: (setf parent-clock) (object)
Package

delorean.

Methods
Writer Method: (setf parent-clock) ((mock-clock mock-clock))

automatically generated writer method

Source

delorean.lisp.

Target Slot

parent-clock.

Generic Function: parent-now (self)
Package

delorean.

Methods
Method: parent-now ((self mock-clock))
Source

delorean.lisp.

Generic Reader: scale (object)
Package

delorean.

Methods
Reader Method: scale ((scaled-clock scaled-clock))

automatically generated reader method

Source

delorean.lisp.

Target Slot

scale.

Generic Writer: (setf scale) (object)
Package

delorean.

Methods
Writer Method: (setf scale) ((scaled-clock scaled-clock))

automatically generated writer method

Source

delorean.lisp.

Target Slot

scale.

Generic Reader: shifted-time (object)
Package

delorean.

Methods
Reader Method: shifted-time ((shifted-clock shifted-clock))

automatically generated reader method

Source

delorean.lisp.

Target Slot

shifted-time.

Generic Writer: (setf shifted-time) (object)
Package

delorean.

Methods
Writer Method: (setf shifted-time) ((shifted-clock shifted-clock))

automatically generated writer method

Source

delorean.lisp.

Target Slot

shifted-time.


5.2.2 Classes

Class: mock-clock

The base class that is extended by all mock clocks

Package

delorean.

Source

delorean.lisp.

Direct subclasses
Direct methods
Direct Default Initargs
InitargValue
:created-at(now)
:parent-clock*clock*
Direct slots
Slot: created-at
Initargs

:created-at

Readers

created-at.

Writers

(setf created-at).

Slot: parent-clock
Initargs

:parent-clock

Readers

parent-clock.

Writers

(setf parent-clock).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   F   G   M   P   S   W  
Index Entry  Section

(
(setf created-at): Private generic functions
(setf created-at): Private generic functions
(setf frozen-time): Private generic functions
(setf frozen-time): Private generic functions
(setf parent-clock): Private generic functions
(setf parent-clock): Private generic functions
(setf scale): Private generic functions
(setf scale): Private generic functions
(setf shifted-time): Private generic functions
(setf shifted-time): Private generic functions

C
clock-now: Public standalone methods
clock-now: Public standalone methods
clock-now: Public standalone methods
created-at: Private generic functions
created-at: Private generic functions

F
frozen-time: Private generic functions
frozen-time: Private generic functions

G
Generic Function, (setf created-at): Private generic functions
Generic Function, (setf frozen-time): Private generic functions
Generic Function, (setf parent-clock): Private generic functions
Generic Function, (setf scale): Private generic functions
Generic Function, (setf shifted-time): Private generic functions
Generic Function, created-at: Private generic functions
Generic Function, frozen-time: Private generic functions
Generic Function, parent-clock: Private generic functions
Generic Function, parent-now: Private generic functions
Generic Function, scale: Private generic functions
Generic Function, shifted-time: Private generic functions

M
Macro, with-frozen-clock: Public macros
Macro, with-scaled-clock: Public macros
Macro, with-shifted-clock: Public macros
Method, (setf created-at): Private generic functions
Method, (setf frozen-time): Private generic functions
Method, (setf parent-clock): Private generic functions
Method, (setf scale): Private generic functions
Method, (setf shifted-time): Private generic functions
Method, clock-now: Public standalone methods
Method, clock-now: Public standalone methods
Method, clock-now: Public standalone methods
Method, created-at: Private generic functions
Method, frozen-time: Private generic functions
Method, parent-clock: Private generic functions
Method, parent-now: Private generic functions
Method, scale: Private generic functions
Method, shifted-time: Private generic functions

P
parent-clock: Private generic functions
parent-clock: Private generic functions
parent-now: Private generic functions
parent-now: Private generic functions

S
scale: Private generic functions
scale: Private generic functions
shifted-time: Private generic functions
shifted-time: Private generic functions

W
with-frozen-clock: Public macros
with-scaled-clock: Public macros
with-shifted-clock: Public macros