Previous: , Up: API  


1.7 (veritas veritas)

1.7.1 Macros

Macro: evaluate-thunks-concurrently x

Given a list of functions that don’t take any inputs, run each one of those functions concurrently, and then return a list of what each function returned once they’re all finished.

Macro: log-debug x

Undocumented macro.

Macro: log-error x

Undocumented macro.

Macro: log-info x

Undocumented macro.

1.7.2 Procedures

Procedure: assert-equal KEY: #:expect #:got #:name

Undocumented procedure.

Procedure: assert-eqv KEY: #:expect #:got #:name

Undocumented procedure.

Procedure: assert-error thunk KEY: #:name

Returns a function taking a VC (veritas-context) that returns an assertion that checks that a thunk (a procedure with no arguments) raises an error when called. This is a crucial function for testing error-handling logic. It attempts to execute the provided thunk. If an error is caught during its execution, the assertion passes. If the thunk completes without raising an error, the assertion fails.

thunk

A procedure of no arguments to be executed.

name

A string to identify the assertion in the logs.

(assert-error (lambda ()
                      (sum-list-elements '(1 2 "a" 4)))
                    #:name
                    "Should fail when list contains non-numbers")
⇒ #<procedure 8f58ec5ce390 at veritas/assert.scm:69:2 (vc)>

;; Upon applying vc to the procedure we will compute the assertion:
`((assertion-successful . #t)
  (assertion-name "Should fail when list contains non-numbers"))
Procedure: assert-false x KEY: #:name

Undocumented procedure.

Procedure: assert-no-error thunk KEY: #:name

Returns a function taking a VC (veritas-context) that returns an assertion that checks that a thunk (a procedure with no arguments) does not raise an error when called. This is a crucial function for testing error-handling logic. It attempts to execute the provided thunk. If no error is caught during its execution, the assertion passes. If the thunk raises an error, the assertion fails.

thunk

A procedure of no arguments to be executed.

name

A string to identify the assertion in the logs.

(assert-no-error (lambda ()
                      (sum-list-elements '(1 2 "a" 4))))
⇒ #<procedure 8f58ec5ce390 at veritas/assert.scm:69:2 (vc)>

;; Upon applying vc to the procedure we will compute the assertion:
`((assertion-successful . #f))
Procedure: assert-true x KEY: #:name

Undocumented procedure.

Procedure: benchmark KEY: #:skip? #:name #:runs #:thunk

Undocumented procedure.

Procedure: collect-assertion-successful xs

Undocumented procedure.

Procedure: do-if-string-contained KEY: #:name #:restriction #:result

Undocumented procedure.

Procedure: fisher-yates-shuffle xs

Returns a randomly shuffled copy of XS.

Procedure: suite name KEY: #:debug? #:shuffle? #:skip? #:concurrent? #:before-all #:after-all . tests

Undocumented procedure.

Procedure: test name KEY: #:debug? #:shuffle? #:skip? #:before #:after . cases

Undocumented procedure.

Procedure: veritas-run KEY: #:shuffle? #:concurrent? #:debug? #:reporter . tasks

Undocumented procedure.


Previous: (veritas shuffle), Up: API