Helper functions for doing bank tests, where you simulate transfers between accounts, and verify that reads always show the same balance. The test map should have these additional options:
:accounts A collection of account identifiers. :total-amount Total amount to allocate. :max-transfer The largest transfer we'll try to execute.
Helper functions for doing bank tests, where you simulate transfers between accounts, and verify that reads always show the same balance. The test map should have these additional options: :accounts A collection of account identifiers. :total-amount Total amount to allocate. :max-transfer The largest transfer we'll try to execute.
(check-op accts total negative-balances? op)
Takes a single op and returns errors in its balance
Takes a single op and returns errors in its balance
(checker checker-opts)
Verifies that all reads must sum to (:total test), and, unless :negative-balances? is true, checks that all balances are non-negative.
Verifies that all reads must sum to (:total test), and, unless :negative-balances? is true, checks that all balances are non-negative.
Transfers only between different accounts.
Transfers only between different accounts.
(err-badness test err)
Takes a bank error and returns a number, depending on its type. Bigger numbers mean more egregious errors.
Takes a bank error and returns a number, depending on its type. Bigger numbers mean more egregious errors.
(generator)
A mixture of reads and transfers for clients.
A mixture of reads and transfers for clients.
(ok-reads history)
Filters a history to just OK reads
Filters a history to just OK reads
(plotter)
Renders a graph of balances over time
Renders a graph of balances over time
(points history)
Turns a history into a seqeunce of [time total-of-accounts] points.
Turns a history into a seqeunce of [time total-of-accounts] points.
(test)
(test opts)
A partial test; bundles together some default choices for keys and amounts with a generator and checker. Options:
:negative-balances? if true, doesn't verify that balances remain positive
A partial test; bundles together some default choices for keys and amounts with a generator and checker. Options: :negative-balances? if true, doesn't verify that balances remain positive
(transfer test process)
Generator of a transfer: a random amount between two randomly selected accounts.
Generator of a transfer: a random amount between two randomly selected accounts.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close