The try Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The try Reference Manual

This is the try Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 06:25:07 2022 GMT+0.

Table of Contents


1 Introduction

# Try Manual

###### \[in package TRY\]
## TRY ASDF System

- Version: 0.0.1
- Description: Try is a test framework.
- Long Description: Try is what we get if we make tests functions and
  build a test framework on top of the condition system as
  [Stefil](https://common-lisp.net/project/stefil/index-old.shtml) did
  but also address the issue of rerunning and replaying, make the IS
  check more capable, use the types of the condition hierarchy to
  parameterize what to debug, print, rerun, and finally document the
  whole thing.
- Licence: MIT, see COPYING.
- Author: Gábor Melis
- Mailto: [mega@retes.hu](mailto:mega@retes.hu)
- Homepage: [http://melisgl.github.io/try](http://melisgl.github.io/try)
- Bug tracker: [https://github.com/melisgl/try/issues](https://github.com/melisgl/try/issues)
- Source control: [GIT](https://github.com/melisgl/try.git)

## Links

Here is the [official repository](https://github.com/melisgl/try)
and the [HTML
documentation](http://melisgl.github.io/mgl-pax-world/try-manual.html)
for the latest version.

## Tutorial

Try is a library for unit testing with equal support for
interactive and non-interactive workflows. Tests are functions, and
almost everything else is a condition, whose types feature
prominently in parameterization.

##### Looking for Truth

@TRY/IS is a replacement for CL:ASSERT, that can capture values of
subforms to provide context to failures:

```common-lisp
(is (= (1+ 5) 0))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (= #1=(1+ 5) 0))
..   where
..     #1# = 6
```

This is a PAX transcript,
output is prefixed with `..` and the unreadable return value with
`==>`.

Note the `#N#` syntax due to *PRINT-CIRCLE*.

##### Checking Multiple Values

IS automatically captures values of
arguments to functions like `1+` in the above example. Values of
other interesting subforms can be explicitly
captured. IS supports capturing multiple
values and can be taught how to deal with macros. The combination of these
features allows MATCH-VALUES to be implementable as tiny extension:

```common-lisp
(is (match-values (values (1+ 5) "sdf")
      (= * 0)
      (string= * "sdf")))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS
..      (MATCH-VALUES #1=(VALUES (1+ 5) #2="sdf")
..        (= * 0)
..        (STRING= * "sdf")))
..   where
..     #1# == 6
..            #2#
```

In the body of MATCH-VALUES, `*` is bound to
successive return values of some form, here `(VALUES (1+ 5) "sdf")`.
MATCH-VALUES comes with an automatic rewrite rule that captures the
values of this form, which are printed above as `#1# == 6 #2#`. IS
is flexible enough that all other checks (SIGNALS, SIGNALS-NOT,
INVOKES-DEBUGGER, INVOKES-DEBUGGER-NOT, FAILS, and IN-TIME are built
on top of it.

##### Writing Tests

Beyond a fancy ASSERT, Try provides tests, which are Lisp functions
that record their execution in TRIAL objects. Let's define a test
and run it:

```common-lisp
(deftest should-work ()
  (is t))

(should-work)
.. SHOULD-WORK            ; TRIAL-START
..   ⋅ (IS T)             ; EXPECTED-RESULT-SUCCESS
.. ⋅ SHOULD-WORK ⋅1       ; EXPECTED-VERDICT-SUCCESS
..
==> #
```

Try is driven by conditions, and the comments to the right give the
type of the condition that is printed on that line. The `⋅`
character marks successes.

We could have run our test with `(TRY 'SHOULD-WORK)`, as well, which
does pretty much the same thing except it defaults to never entering
the debugger, whereas calling a test function directly enters the
debugger on events whose type matches the type in the variable
*DEBUG*.

```common-lisp
(try 'should-work)
.. SHOULD-WORK
..   ⋅ (IS T)
.. ⋅ SHOULD-WORK ⋅1
..
==> #
```

##### Test Suites

Test suites are just tests which call other tests.

```common-lisp
(deftest my-suite ()
  (should-work)
  (is (= (foo) 5)))

(defun foo ()
  4)

(try 'my-suite)
.. MY-SUITE                 ; TRIAL-START
..   SHOULD-WORK            ; TRIAL-START
..     ⋅ (IS T)             ; EXPECTED-RESULT-SUCCESS
..   ⋅ SHOULD-WORK ⋅1       ; EXPECTED-VERDICT-SUCCESS
..   ⊠ (IS (= #1=(FOO) 5))  ; UNEXPECTED-RESULT-FAILURE
..     where
..       #1# = 4
.. ⊠ MY-SUITE ⊠1 ⋅1         ; UNEXPECTED-VERDICT-FAILURE
..
==> #
```

`⊠` marks UNEXPECTED-FAILUREs. Note how the failure of `(IS (= (FOO)
5))` caused `MY-SUITE` to fail as well.

##### Filtering Output

To focus on the important bits, we can print only the UNEXPECTED
events:

```common-lisp
(try 'my-suite :print 'unexpected)
.. MY-SUITE
..   ⊠ (IS (= #1=(FOO) 5))
..     where
..       #1# = 4
.. ⊠ MY-SUITE ⊠1 ⋅1
..
==> #
```

Note that `SHOULD-WORK` is still run, and its check's success is
counted as evidenced by`⋅1`. The above effect can also be achieved
without running the tests again with REPLAY-EVENTS.

##### Debugging

Let's figure out what went wrong:

```
(my-suite)

;;; Here the debugger is invoked:
UNEXPECTED-FAILURE in check:
  (IS (= #1=(FOO) 5))
where
  #1# = 4
Restarts:
 0: [RECORD-EVENT] Record the event and continue.
 1: [FORCE-EXPECTED-SUCCESS] Change outcome to TRY:EXPECTED-RESULT-SUCCESS.
 2: [FORCE-UNEXPECTED-SUCCESS] Change outcome to TRY:UNEXPECTED-RESULT-SUCCESS.
 3: [FORCE-EXPECTED-FAILURE] Change outcome to TRY:EXPECTED-RESULT-FAILURE.
 4: [ABORT-CHECK] Change outcome to TRY:RESULT-ABORT*.
 5: [SKIP-CHECK] Change outcome to TRY:RESULT-SKIP.
 6: [RETRY-CHECK] Retry check.
 7: [ABORT-TRIAL] Record the event and abort trial TRY::MY-SUITE.
 8: [SKIP-TRIAL] Record the event and skip trial TRY::MY-SUITE.
 9: [RETRY-TRIAL] Record the event and retry trial TRY::MY-SUITE.
 10: [SET-TRY-DEBUG] Supply a new value for :DEBUG of TRY:TRY.
 11: [RETRY] Retry SLIME interactive evaluation request.
```

In the [SLIME](https://common-lisp.net/project/slime/doc/html/)
debugger, we press `v` on the frame of the call to `MY-SUITE` to
navigate to its definition, realize what the problem is and fix
`FOO`:

```common-lisp
(defun foo ()
  5)
```

Now, we select the `RETRY-TRIAL` restart, and on the retry
`MY-SUITE` passes. The full output is:

```
MY-SUITE
  SHOULD-WORK
    ⋅ (IS T)
  ⋅ SHOULD-WORK ⋅1
WARNING: redefining TRY::FOO in DEFUN
  ⊠ (IS (= #1=(FOO) 5))
    where
      #1# = 4
MY-SUITE retry #1
  SHOULD-WORK
    ⋅ (IS T)
  ⋅ SHOULD-WORK ⋅1
  ⋅ (IS (= (FOO) 5))
⋅ MY-SUITE ⋅2
```

##### Rerunning Stuff

Instead of working interactively, one can fix the failing test and
rerun it. Now, let's fix `MY-SUITE` and rerun it:

```common-lisp
(deftest my-suite ()
  (should-work)
  (is nil))

(try 'my-suite)
.. MY-SUITE
..   SHOULD-WORK
..     ⋅ (IS T)
..   ⋅ SHOULD-WORK ⋅1
..   ⊠ (IS NIL)
.. ⊠ MY-SUITE ⊠1 ⋅1
..
==> #

(deftest my-suite ()
  (should-work)
  (is t))

(try !)
.. MY-SUITE
..   ⋅ (IS T)
.. ⋅ MY-SUITE ⋅1
..
==> #
```

Here, `!` refers to the most recent TRIAL returned by TRY. When a
trial is passed to TRY or is `FUNCALL`ed, trials in it which match
the type in TRY's RERUN argument are rerun (here, UNEXPECTED by
default). `SHOULD-WORK` and its check are `EXPECTED-SUCCESS`es,
hence they don't match UNEXPECTED and are not rerun.

##### Conditional Execution

Conditional execution can be achieved simply testing the TRIAL
object returned by @TRY/TESTS.

```
(deftest my-suite ()
  (when (passedp (should-work))
    (is t :msg "a test that depends on SHOULD-WORK")
    (when (is nil)
      (is nil :msg "never run"))))
```

##### Skipping

```common-lisp
(deftest my-suite ()
  (with-skip ((not (server-available-p)))
    (test-server)))

(deftest test-server ()
  (is t))

(defun server-available-p ()
  nil)

(my-suite)
==> #
```

In the above, `TEST-SERVER` was skipped. No checks were made, no
errors happened, so nothing was printed.

##### Expecting Outcomes

```common-lisp
(deftest known-broken ()
  (with-failure-expected (t)
    (is nil)))

(known-broken)
.. KNOWN-BROKEN
..   × (IS NIL)
.. ⋅ KNOWN-BROKEN ×1
..
==> #
```

`×` marks `EXPECTED-SUCCESS`es. `(WITH-SKIP (T) ...)` makes all
checks successes and failures EXPECTED, which are counted in their
own *CATEGORIES* by default but don't make the enclosing tests to
fail. Also see WITH-EXPECTED-OUTCOME.

##### Running Tests on Definition

With *RUN-DEFTEST-WHEN*, one can run test on definition. To run
tests on evaluation, as in SLIME `C-M-x`, `slime-eval-defun`:

```common-lisp
(setq *run-deftest-when* :execute)

(deftest some-test ()
  (is t))
.. SOME-TEST
..   ⋅ (IS T)
.. ⋅ SOME-TEST ⋅1
..
=> SOME-TEST

(setq *run-deftest-when* nil)
```

##### Fixtures

There is no direct support for fixtures in Try. One can easily write
macros like the following.

```
(defvar *server* nil)

(defmacro with-xxx (&body body)
  `(flet ((,with-xxx-body ()
            ,@body))
     (if *server*
         (with-xxx-body)
         (with-server (make-expensive-server)
           (with-xxx-body)))))
```

Plus, with support for selectively @TRY/RERUN, the need for fixtures
is lessened.

##### Packages

The suggested way of writing tests is to call test functions
explicitly:

```
(defpackage :some-test-package
  (:use #:common-lisp #:try))
(in-package :some-test-package)

(deftest test-all ()
  (test-this)
  (test-that))

(deftest test-this ()
  (test-this/more))

(deftest test-this/more ()
  (is t))

(deftest test-that ()
  (is t))

(deftest not-called ()
  (is t))

(defun test ()
  (warn-on-tests-not-run ((find-package :some-test-package))
    (try 'test-all)))

(test)
.. TEST-ALL
..   TEST-THIS
..     TEST-THIS/MORE
..       ⋅ (IS T)
..     ⋅ TEST-THIS/MORE ⋅1
..   ⋅ TEST-THIS ⋅1
..   TEST-THAT
..     ⋅ (IS T)
..   ⋅ TEST-THAT ⋅1
.. ⋅ TEST-ALL ⋅2
.. WARNING: Test NOT-CALLED not run.
==> #
```

Note how the TEST function uses WARN-ON-TESTS-NOT-RUN to catch any
tests defined in `SOME-TEST-PACKAGE` that were not run. Tests can be
deleted by FMAKUNBOUND, UNINTERN, or by redefining the function with
DEFUN. Tests defined in a given package can be listed with
LIST-PACKAGE-TESTS.

This style allows higher level tests to establish the dynamic
environment necessary for lower level tests.

## Events

Try is built around events implemented as CONDITIONs.
Matching the types of events to *DEBUG*, *COUNT*, *COLLECT*, *RERUN*,
*PRINT*, and *DESCRIBE* is what gives Try its flexibility.

### Middle Layer of Events

The event hierarchy is fairly involved, so let's start in the middle.
The condition EVENT has 4 disjoint subclasses:

- TRIAL-START, which corresponds to the entry to a test (see
  @TRY/TESTS),

- VERDICT, the OUTCOME of a TRIAL,

- RESULT, the OUTCOME of a check (see @TRY/CHECKS), and

- ERROR\*, an unexpected CL:ERROR or unadorned @NON-LOCAL-EXIT.

```common-lisp
(let (;; We don't want to debug nor print a backtrace for the error below.
      (*debug* nil)
      (*describe* nil))
  ;; signals TRIAL-START / VERDICT-ABORT* on entry / exit
  (with-test (demo)
    ;; signals EXPECTED-RESULT-SUCCESS
    (is t)
    ;; signals UNHANDLED-ERROR with a nested CL:ERROR
    (error "xxx")))
.. DEMO                       ; TRIAL-START
..   ⋅ (IS T)                 ; EXPECTED-RESULT-SUCCESS (⋅)
..   ⊟ "xxx" (SIMPLE-ERROR)   ; UNHANDLED-ERROR (⊟)
.. ⊟ DEMO ⊟1 ⋅1               ; VERDICT-ABORT* (⊟)
..
==> #
```


### Concrete Events

The non-abstract condition classes of events that are actually
signalled are called concrete.

TRIAL-START is a concrete event class. RESULTs and VERDICTs have six
 concrete subclasses:

- EXPECTED-RESULT-SUCCESS, UNEXPECTED-RESULT-SUCCESS,
   EXPECTED-RESULT-FAILURE, UNEXPECTED-RESULT-FAILURE,
   RESULT-SKIP, RESULT-ABORT\*

- EXPECTED-VERDICT-SUCCESS, UNEXPECTED-VERDICT-SUCCESS,
   EXPECTED-VERDICT-FAILURE, UNEXPECTED-VERDICT-FAILURE,
   VERDICT-SKIP, VERDICT-ABORT\*

ERROR\* is an abstract class with two concrete subclasses:

- UNHANDLED-ERROR, signalled when a CL:ERROR reaches the handler set
   up by DEFTEST or WITH-TEST, or when the debugger is invoked.

- NLX, signalled when no error was detected by the handler, but the
   trial finishes with a @NON-LOCAL-EXIT.

These are the 15 concrete event classes.

### Event Glue

These condition classes group various bits of the
@TRY/CONCRETE-EVENTS and the @TRY/MIDDLE-LAYER-OF-EVENTS for ease of
reference.

Concrete event classes except TRIAL-START are subclasses of
hyphen-separated words in their name. For example,
UNEXPECTED-RESULT-FAILURE inherits from UNEXPECTED, RESULT, and
FAILURE, so it matches types such as UNEXPECTED or `(AND UNEXPECTED
RESULT)`.

- [condition] EVENT

    Common abstract superclass of all events in Try.

- [condition] EXPECTED EVENT

    Concrete condition classes with EXPECTED in their
    name are subclasses of EXPECTED. SKIP is also a subclass of
    EXPECTED.

- [condition] UNEXPECTED EVENT

    Concrete condition classes with UNEXPECTED in their
    name are subclasses of UNEXPECTED. ABORT\* is also a subclass of
    UNEXPECTED.

- [condition] SUCCESS EVENT

    See @TRY/CHECKS and @TRY/TRIAL-VERDICTS for how
    SUCCESS or FAILURE is decided.

- [condition] FAILURE EVENT

    See SUCCESS.

- [condition] DISMISSAL EVENT

    The third possibility after SUCCESS and FAILURE.
    Either SKIP or ABORT\*.

- [condition] ABORT* UNEXPECTED

    `RESULT-ABORT*`, `VERDICT-ABORT*` or ERROR\*.

- [condition] SKIP EXPECTED DISMISSAL

    RESULT-SKIP or VERDICT-SKIP.

- [condition] LEAF EVENT

    RESULT or ERROR\*.

- [type] EXPECTED-SUCCESS

    A shorthand for `(AND EXPECTED SUCCESS)`.

- [type] UNEXPECTED-SUCCESS

    A shorthand for `(AND UNEXPECTED SUCCESS)`.

- [type] EXPECTED-FAILURE

    A shorthand for `(AND EXPECTED FAILURE)`.

- [type] UNEXPECTED-FAILURE

    A shorthand for `(AND UNEXPECTED FAILURE)`.

- [type] PASS

    An OUTCOME that's not an ABORT\* or an UNEXPECTED FAILURE.

- [type] FAIL

    An ABORT\* or an UNEXPECTED FAILURE.

### Printing Events

- [variable] *EVENT-PRINT-BINDINGS* ((\*PRINT-CIRCLE\* T))

    EVENTs are conditions signalled in code that may change printer
    variables such as *PRINT-CIRCLE*, *PRINT-LENGTH*, etc. To control
    how events are printed, the list of variable bindings in
    *EVENT-PRINT-BINDINGS* is established whenever an EVENT is printed
    as if with:
    
    ```
    (progv (mapcar #'first *event-print-bindings*)
           (mapcar #'second *event-print-bindings*)
      ...)
    ```
    
    The default value ensures that shared structure is recognized (see
    @TRY/CAPTURES). If the `#N#` syntax feels cumbersome, then change
    this variable.

### Event Restarts

Only RECORD-EVENT is applicable to all EVENTs. See
@TRY/CHECK-RESTARTS, @TRY/TRIAL-RESTARTS for more.

- [function] RECORD-EVENT &OPTIONAL CONDITION

    This restart is always the first restart available when an EVENT is
    signalled running under TRY (i.e. there is a CURRENT-TRIAL). TRY
    always invokes RECORD-EVENT when handling events.

### Outcomes

- [condition] OUTCOME EVENT

    An OUTCOME is the resolution of either a TRIAL or a
    check (see @TRY/CHECKS), corresponding to subclasses VERDICT and
    RESULT.

- [macro] WITH-EXPECTED-OUTCOME (EXPECTED-TYPE) &BODY BODY

    When an OUTCOME is to be signalled, EXPECTED-TYPE determines
    whether it's going to be EXPECTED. The concrete OUTCOME classes are
    `{EXPECTED,UNEXPECTED}-{RESULT,VERDICT}-{SUCCESS,FAILURE}` (see
    @TRY/EVENTS), of which RESULT or VERDICT and SUCCESS or FAILURE are
    already known. If a RESULT FAILURE is to be signalled, then the
    moral equivalent of `(SUBTYPEP '(AND RESULT FAILURE) EXPECTED-TYPE)`
    is evaluated and depending on whether it's true,
    EXPECTED-RESULT-FAILURE or UNEXPECTED-RESULT-FAILURE is signalled.
    
    By default, SUCCESS is expected. The following example shows how to
    expect both SUCCESS and FAILURE for RESULTs, while requiring
    VERDICTs to succeed:
    
    ```common-lisp
    (let ((*debug* nil))
      (with-expected-outcome ('(or result (and verdict success)))
        (with-test (t1)
          (is nil))))
    .. T1
    ..   × (IS NIL)
    .. ⋅ T1 ×1
    ..
    ==> #
    ```
    
    This is equivalent to `(WITH-FAILURE-EXPECTED () ...)`. To make
    result failures expected but result successes unexpected:
    
    ```common-lisp
    (let ((*debug* nil))
      (with-expected-outcome ('(or (and result failure) (and verdict success)))
        (with-test (t1)
          (is t)
          (is nil))))
    .. T1
    ..   ⊡ (IS T)
    ..   × (IS NIL)
    .. ⋅ T1 ⊡1 ×1
    ..
    ==> #
    ```
    
    This is equivalent to `(WITH-FAILURE-EXPECTED ('FAILURE) ...)`. The
    final example leaves result failures unexpected but makes both
    verdict successes and failures expected:
    
    ```common-lisp
    (let ((*debug* nil))
      (with-expected-outcome ('(or (and result success) verdict))
        (with-test (t1)
          (is nil))))
    .. T1
    ..   ⊠ (IS NIL)
    .. × T1 ⊠1
    ..
    ==> #
    ```


- [macro] WITH-FAILURE-EXPECTED (&OPTIONAL (RESULT-EXPECTED-TYPE T) (VERDICT-EXPECTED-TYPE ''SUCCESS)) &BODY BODY

    A convenience macro on top of WITH-EXPECTED-OUTCOME,
    WITH-FAILURE-EXPECTED expects VERDICTs to have VERDICT-EXPECTED-TYPE
    and RESULTs to have RESULT-EXPECTED-TYPE. A simple
    `(WITH-FAILURE-EXPECTED () ...)` makes all RESULT `SUCCESS`es and
    FAILUREs EXPECTED. `(WITH-FAILURE-EXPECTED ('FAILURE) ..)` expects
    FAILUREs only, and any `SUCCESS`es will be UNEXPECTED.

- [macro] WITH-SKIP (&OPTIONAL (SKIP T)) &BODY BODY

    WITH-SKIP skips checks and trials. It forces an immediate
    SKIP-TRIAL whenever a trial is started (which turns into a
    VERDICT-SKIP) and makes checks (without intervening trials, of
    course) evaluate normally but signal RESULT-SKIP. SKIP is NIL
    cancels the effect of any enclosing WITH-SKIP with SKIP true.

#### Outcome Restarts

- [function] FORCE-EXPECTED-SUCCESS &OPTIONAL CONDITION

    Change the type of the OUTCOME being signalled to EXPECTED and
    SUCCESS. If the original condition is a RESULT, then this will be
    EXPECTED-RESULT-SUCCESS, if it is a VERDICT, then
    EXPECTED-VERDICT-SUCCESS.

- [function] FORCE-UNEXPECTED-SUCCESS &OPTIONAL CONDITION

    Change the type of OUTCOME being signalled to UNEXPECTED and
    SUCCESS.

- [function] FORCE-EXPECTED-FAILURE &OPTIONAL CONDITION

    Change the type of OUTCOME being signalled to EXPECTED and
    FAILURE.

- [function] FORCE-UNEXPECTED-FAILURE &OPTIONAL CONDITION

    Change the type of OUTCOME being signalled to UNEXPECTED and
    FAILURE.

#### Checks

Checks are like CL:ASSERTs, they check whether some condition holds
and signal an OUTCOME. The outcome signalled for checks is a
subclass of RESULT.

Take, for example, `(IS (= X 5))`. Depending on whether `X` is
indeed 5, some kind of RESULT SUCCESS or FAILURE will be signalled.
WITH-EXPECTED-OUTCOME determines whether it's EXPECTED or
UNEXPECTED, and we have one of EXPECTED-RESULT-SUCCESS,
UNEXPECTED-RESULT-SUCCESS, EXPECTED-RESULT-FAILURE,
UNEXPECTED-RESULT-FAILURE to signal. Furthermore, if WITH-SKIP is in
effect, then RESULT-SKIP is signalled.

The result is signalled with `#'SIGNAL` if it is a PASS, else it's
signalled with `#'ERROR`. This distinction matters only if the event
is not handled, which is never the case in a TRIAL. Standalone
checks though - those that are not enclosed by a trial - invoke the
debugger on RESULTs which are not of type PASS.

The signalled RESULT is not final until RECORD-EVENT is invoked on
it, and it can be changed with the @TRY/OUTCOME-RESTARTS and the
@TRY/CHECK-RESTARTS.

- [condition] RESULT LEAF OUTCOME

- [condition] EXPECTED-RESULT-SUCCESS EXPECTED RESULT SUCCESS

- [condition] UNEXPECTED-RESULT-SUCCESS UNEXPECTED RESULT SUCCESS

- [condition] EXPECTED-RESULT-FAILURE EXPECTED RESULT FAILURE

- [condition] UNEXPECTED-RESULT-FAILURE UNEXPECTED RESULT FAILURE

- [condition] RESULT-SKIP RESULT SKIP

- [condition] RESULT-ABORT* RESULT ABORT\* DISMISSAL

##### Check Restarts

- [function] ABORT-CHECK &OPTIONAL CONDITION

    Change the OUTCOME of the check being signalled to `RESULT-ABORT*`.
    `RESULT-ABORT*`, being `(NOT PASS)`, will cause the check to return
    NIL if RECORD-EVENT is invoked on it.

- [function] SKIP-CHECK &OPTIONAL CONDITION

    Change the OUTCOME of the check being signalled to RESULT-SKIP.
    RESULT-SKIP, being a PASS, will cause the check to return T if
    CONTINUE or RECORD-EVENT is invoked on it.

- [function] RETRY-CHECK &OPTIONAL CONDITION

    Initiate a @NON-LOCAL-EXIT to go reevaluate the forms wrapped by
    the check without signalling an OUTCOME.

#### Trials

- [type] TRIAL

    Trials are records of calls to tests (see
    @TRY/COUNT, @TRY/COLLECT). Their behaviour as @FUNCALLABLE-INSTANCEs
    is explained in @TRY/RERUN.
    
    There are three ways to acquire a TRIAL object: by calling
    CURRENT-TRIAL, through the lexical binding of the symbol that names
    the test or through the return value of a test:
    
    ```common-lisp
    (deftest xxx ()
      (prin1 xxx))
    
    (xxx)
    .. #
    ==> #
    ```
    
    WITH-TRIAL can also provide access to its TRIAL:
    
    ```common-lisp
    (with-test (t0)
      (prin1 t0))
    .. #
    ==> #
    ```
    
    TRIALs are not to be instantiated by client code.

- [function] CURRENT-TRIAL

    TRIALs, like the calls to tests they stand for, nest. CURRENT-TRIAL
    returns the innermost trial. If there is no currently running test,
    then an error is signalled. The returned trial is RUNNINGP.

##### Trial Events

- [condition] TRIAL-EVENT EVENT

    A TRIAL-EVENT is either a TRIAL-START or a
    VERDICT.

- [reader] TRIAL TRIAL-EVENT (:TRIAL)

- [condition] TRIAL-START TRIAL-EVENT

    TRIAL-START is signalled when a test function
    (see @TRY/TESTS) is entered and a TRIAL is started, it is already
    the CURRENT-TRIAL, and the @TRY/TRIAL-RESTARTS are available. It is
    also signalled when a trial is retried:
    
    ```common-lisp
    (let ((*print* nil)
          (n 0))
      (with-test ()
        (handler-bind ((trial-start (lambda (c)
                                      (format t "TRIAL-START for ~S retry#~S~%"
                                              (test-name (trial c))
                                              (n-retries (trial c))))))
          (with-test (this)
            (incf n)
            (when (< n 3)
              (retry-trial))))))
    .. TRIAL-START for THIS retry#0
    .. TRIAL-START for THIS retry#1
    .. TRIAL-START for THIS retry#2
    ..
    ```
    
    The matching of TRIAL-START events is less straightforward than that
    of other EVENTs.
    
    - When a TRIAL-START event matches the `COLLECT` type (see
      @TRY/COLLECT), its TRIAL is collected.
    
    - Similarly, when a TRIAL-START matches the PRINT
      type (see @TRY/PRINT), it is printed immediately, and its trial's
      VERDICT will be printed too regardless of whether it matches
      PRINT. If TRIAL-START does not match
      PRINT, it may still be printed if for example
      *PRINT-PARENT* requires it.
    
    - When a TRIAL-START matches the `RERUN` type (see @TRY/RERUN), its
      TRIAL may be rerun.
    
    - Also, see WITH-SKIP.


- [condition] VERDICT TRIAL-EVENT OUTCOME

    A VERDICT is the OUTCOME of a TRIAL. It is one of
    `{EXPECTED,UNEXPECTED}-VERDICT-{SUCCESS,FAILURE}`, VERDICT-SKIP and
    VERDICT-ABORT\*. Regarding how the verdict type is determined, see
    @TRY/TRIAL-VERDICTS.
    
    Verdicts are signalled while their TRIAL is
    still the CURRENT-TRIAL, and @TRY/TRIAL-RESTARTS are still
    available.
    
    ```common-lisp
    (try (lambda ()
           (handler-bind (((and verdict failure) #'retry-trial))
             (with-test (this)
               (is (zerop (random 2)))))))
    .. (TRY #)
    ..   THIS
    ..     ⊠ (IS (ZEROP #1=(RANDOM 2)))
    ..       where
    ..         #1# = 1
    ..   THIS retry #1
    ..     ⋅ (IS (ZEROP (RANDOM 2)))
    ..   ⋅ THIS ⋅1
    .. ⋅ (TRY #) ⋅1
    ..
    ==> #) EXPECTED-SUCCESS 0.000s ⋅1>
    ```


- [condition] EXPECTED-VERDICT-SUCCESS EXPECTED VERDICT SUCCESS

- [condition] UNEXPECTED-VERDICT-SUCCESS UNEXPECTED VERDICT SUCCESS

- [condition] EXPECTED-VERDICT-FAILURE EXPECTED VERDICT FAILURE

- [condition] UNEXPECTED-VERDICT-FAILURE UNEXPECTED VERDICT FAILURE

- [condition] VERDICT-SKIP VERDICT SKIP

- [condition] VERDICT-ABORT* VERDICT ABORT\* DISMISSAL

##### Trial Verdicts

When a trial finished, a VERDICT is signalled. The verdict's type
is determined as follows.

- It is a VERDICT-SKIP if

    - SKIP-TRIAL was called on the trial, or

    - ABORT-TRIAL, SKIP-TRIAL, or RETRY-TRIAL was called on an
      enclosing trial, and

    - these were not overruled by a later ABORT-TRIAL or RETRY-TRIAL
      on the trial.

- It is a VERDICT-ABORT\* if ABORT-TRIAL was called on the trial, and
  it wasn't overruled by a later SKIP-TRIAL or RETRY-TRIAL.

- If all children (including those not collected in CHILDREN) of the
  trial PASS, then the verdict will be a SUCCESS, else it will be a
  FAILURE.

- Subject to the WITH-EXPECTED-OUTCOME in effect,
  `{EXPECTED,UNEXPECTED}-VERDICT-{SUCCESS,FAILURE}` is the type of
  the verdict which will be signalled.

The verdict of this type is signalled, but its type can be changed
by the @TRY/OUTCOME-RESTARTS or the @TRY/TRIAL-RESTARTS before
RECORD-EVENT is invoked on it.

- [reader] VERDICT TRIAL (= NIL)

    The VERDICT EVENT signalled when this
    TRIAL finished or NIL if it has not finished yet.

- [function] RUNNINGP TRIAL

    See if the function call associated with TRIAL has not returned yet.
    Trials that are not running have a VERDICT and are said to be
    finished.

- [function] PASSEDP TRIAL

    See if TRIAL has finished and its VERDICT is a
    PASS.

- [function] FAILEDP TRIAL

    See if TRIAL has finished and its VERDICT is a
    FAIL.

##### Trial Restarts

There are three restarts available for manipulating running
trials: ABORT-TRIAL, SKIP-TRIAL, and RETRY-TRIAL. They may be
invoked programatically or from the debugger. ABORT-TRIAL is also
invoked by TRY when encountering UNHANDLED-ERROR.

The functions below invoke one of these restarts associated with a
TRIAL. It is an error to call them on trials that are not RUNNINGP,
but they may be called on trials other than the CURRENT-TRIAL. In
that case, any intervening trials are skipped.

```common-lisp
;; Skipped trials are marked with '-' in the output.
(with-test (outer)
  (with-test (inner)
    (is t)
    (skip-trial nil outer)))
.. OUTER
..   INNER
..     ⋅ (IS T)
..   - INNER ⋅1
.. - OUTER ⋅1
..
==> #
```

Furthermore, all three restarts initiate a @NON-LOCAL-EXIT to return
from the trial. If during the unwinding of the stack, the
non-local-exit is cancelled (see @CANCELLED-NLX), the appropriate
restart will be invoked upon returning from the trial. In the
following example, the non-local exit from a skip is cancelled by a
THROW.

```common-lisp
(with-test (some-test)
  (catch 'foo
    (unwind-protect
         (skip-trial)
      (throw 'foo nil)))
  (is t :msg "check after skip"))
.. SOME-TEST
..   ⋅ check after skip
.. - SOME-TEST ⋅1
..
==> #
```

In the next example, the non-local exit from a skip is cancelled by
an ERROR, which triggers an ABORT-TRIAL.

```common-lisp
(let ((*debug* nil)
      (*describe* nil))
  (with-test (foo)
    (unwind-protect
         (skip-trial)
      (error "xxx"))))
.. FOO
..   ⊟ "xxx" (SIMPLE-ERROR)
.. ⊟ FOO ⊟1
..
==> #
```

All three restarts may be invoked on any EVENT, including the
trial's own TRIAL-START and VERDICT. If their CONDITION
argument is an EVENT (RETRY-TRIAL has a special case here), they
also record it (as in RECORD-EVENT) to ensure that when they handle
an EVENT in the debugger or programatically that event is not
dropped.

- [function] ABORT-TRIAL &OPTIONAL CONDITION (TRIAL (CURRENT-TRIAL))

    Invoke the ABORT-TRIAL restart of a RUNNINGP TRIAL.
    
    When CONDITION is a VERDICT for TRIAL, ABORT-TRIAL signals a new
    verdict of type VERDICT-ABORT*. This behavior is similar to that of
    ABORT-CHECK. Else, the ABORT-TRIAL restart may record CONDITION,
    then it initiates a @NON-LOCAL-EXIT to return from the test function
    with VERDICT-ABORT*. If during the unwinding SKIP-TRIAL or
    RETRY-TRIAL is called, then the abort is cancelled.
    
    Since ABORT\* is an UNEXPECTED EVENT, ABORT-TRIAL is rarely used
    programatically. Signalling any error in a trial that's not caught
    before the trial's handler catches it will get turned into an
    UNHANDLED-ERROR, and TRY will invoke ABORT-TRIAL with it. Thus,
    instead of invoking ABORT-TRIAL directly, signalling an error will
    often suffice.

- [function] SKIP-TRIAL &OPTIONAL CONDITION (TRIAL (CURRENT-TRIAL))

    Invoke the SKIP-TRIAL restart of a RUNNINGP TRIAL.
    
    When CONDITION is a VERDICT for TRIAL, SKIP-TRIAL signals a new
    verdict of type VERDICT-SKIP. This behavior is similar to that of
    SKIP-CHECK. Else, the SKIP-TRIAL restart may record CONDITION, then
    it initiates a @NON-LOCAL-EXIT to return from the test function with
    VERDICT-SKIP. If during the unwinding ABORT-TRIAL or RETRY-TRIAL is
    called, then the skip is cancelled.
    
    ```common-lisp
    (with-test (skipped)
      (handler-bind ((unexpected-result-failure #'skip-trial))
        (is nil)))
    .. SKIPPED
    ..   ⊠ (IS NIL)
    .. - SKIPPED ⊠1
    ..
    ==> #
    ```
    
    Invoking SKIP-TRIAL on the TRIAL's own TRIAL-START skips the trial
    being started.
    
    ```common-lisp
    (let ((*print* '(or outcome leaf)))
      (with-test (parent)
        (handler-bind ((trial-start #'skip-trial))
          (with-test (child)
            (is nil)))))
    .. PARENT
    ..   - CHILD
    .. ⋅ PARENT
    ..
    ```


- [function] RETRY-TRIAL &OPTIONAL CONDITION (TRIAL (CURRENT-TRIAL))

    Invoke the RETRY-TRIAL restart of RUNNINGP TRIAL. The RETRY-TRIAL
    restart may record CONDITION, then it initiates a @NON-LOCAL-EXIT to
    go back to the beginning of the test function. If the non-local exit
    completes, then
    
    - (N-RETRIES TRIAL) is incremented,
    
    - collected results and trials are cleared (see @TRY/COLLECT),
    
    - counts are zeroed (see @TRY/COUNT), and
    
    - TRIAL-START is signalled again.
    
    If during the unwinding ABORT-TRIAL or SKIP-TRIAL is called, then
    the retry is cancelled.
    
    CONDITION (which may be NIL) is recorded if it is an EVENT but not
    the VERDICT of TRIAL, and the RECORD-EVENT restart is available.

- [reader] N-RETRIES TRIAL (:N-RETRIES = 0)

    The number of times this TRIAL has
    been retried. See RETRY-TRIAL.

### Errors

- [condition] ERROR* ABORT\* TRIAL-EVENT LEAF

    Either UNHANDLED-ERROR or NLX, ERROR\* causes or
    represents abnormal termination of a TRIAL. ABORT-TRIAL can be
    called with ERROR\*s, but there is little need for explicitly doing
    so as RECORD-EVENT, which TRY invokes, takes care of this.

- [reader] TEST-NAME ERROR\* (:TEST-NAME)

- [condition] UNHANDLED-ERROR ERROR\*

    Signalled when an CL:ERROR condition reaches the
    handlers set up DEFTEST or WITH-TEST, or when their *DEBUGGER-HOOK*
    is invoked with a condition that's not an EVENT.

- [reader] NESTED-CONDITION UNHANDLED-ERROR (:CONDITION = 'NIL)

- [reader] BACKTRACE-OF UNHANDLED-ERROR (:BACKTRACE = 'NIL)

- [reader] DEBUGGER-INVOKED-P UNHANDLED-ERROR (:DEBUGGER-INVOKED-P = 'NIL)

- [variable] *GATHER-BACKTRACE* T

    Capturing the backtrace can be expensive. *GATHER-BACKTRACE*
    controls whether UNHANDLED-ERRORs shall have their BACKTRACE-OF
    populated.

- [condition] NLX ERROR\*

    Representing a @NON-LOCAL-EXIT of unknown origin,
    this is signalled if a TRIAL does not return normally although it
    should have because it was not dismissed (see DISMISSAL, SKIP-TRIAL,
    ABORT-TRIAL). In this case, there is no CL:ERROR associated with the
    event.

### Categories

Categories determine how event types are printed and events of
what types are counted together.

The default value of *CATEGORIES* is

```
((abort*             :marker "⊟")
 (unexpected-failure :marker "⊠")
 (unexpected-success :marker "⊡")
 (skip               :marker "-")
 (expected-failure   :marker "×")
 (expected-success   :marker "⋅"))
```

which says that all concrete EVENTs that are of type ABORT\* (i.e.
`RESULT-ABORT*`, `VERDICT-ABORT*`, UNHANDLED-ERROR, and NLX) are to
be marked with `"⊟"` when printed (see @TRY/PRINT). Also, the six
types define six counters for @TRY/COUNT. Note that UNEXPECTED
events have the same marker but squared as their EXPECTED
counterpart.

- [variable] *CATEGORIES* "- see above -"

    A list of of elements like `(TYPE &KEY MARKER)`.
    When @TRY/PRINT, @TRY/CONCRETE-EVENTS are printed with the marker of
    the first matching type. When @TRY/COUNT, the counts associated with
    all matching types are incremented.

- [function] FANCY-STD-CATEGORIES

    Returns the default value of *CATEGORIES* (see @TRY/CATEGORIES),
    which contains some fancy Unicode characters.

- [function] ASCII-STD-CATEGORIES

    Returns a value suitable for *CATEGORIES*, which uses only ASCII
    characters for the markers.
    
    ```
    '((abort*             :marker "!")
      (unexpected-failure :marker "F")
      (unexpected-success :marker ":")
      (skip               :marker "-")
      (expected-failure   :marker "f")
      (expected-success   :marker "."))
    ```


## The IS Macro

IS is the most fundamental one among @TRY/CHECKS, on which all
the others are built, and it is a replacement for CL:ASSERT that can
capture values of subforms to provide context to failures:

```common-lisp
(is (= (1+ 5) 0))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (= #1=(1+ 5) 0))
..   where
..     #1# = 6
```

IS automatically captures values of arguments to functions like `1+`
in the above example. Values of other interesting subforms can be
explicitly requested to be captured. IS supports capturing multiple
values and can be taught how to deal with macros. The combination of
these features allows MATCH-VALUES to be implementable as tiny
extension:

```common-lisp
(is (match-values (values (1+ 5) "sdf")
      (= * 0)
      (string= * "sdf")))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS
..      (MATCH-VALUES #1=(VALUES (1+ 5) #2="sdf")
..        (= * 0)
..        (STRING= * "sdf")))
..   where
..     #1# == 6
..            #2#
```

IS is flexible enough that all other checks (SIGNALS, SIGNALS-NOT,
INVOKES-DEBUGGER, INVOKES-DEBUGGER-NOT, FAILS, and IN-TIME are built
on top of it.

- [macro] IS FORM &KEY MSG CTX (CAPTURE T) (PRINT-CAPTURES T) (RETRY T)

    Evaluate FORM and signal a RESULT SUCCESS if its first return
    value is not NIL, else signal a RESULT FAILURE (see @TRY/OUTCOMES).
    IS returns normally if
    
    - the RECORD-EVENT restart is invoked (available when running in a
      trial), or
    
    - the CONTINUE restart is invoked (available when not running in a
      trial), or
    
    - the signalled RESULT condition is not handled (possible only when
      not running in a trial, and the result is a PASS).
    
    The return value of IS is T if the last condition signalled is a
    SUCCESS, and NIL otherwise.
    
    MSG and CTX are @TRY/FORMAT-SPECIFIER-FORMS. MSG prints a
    description of the check being made, which is by default the whole
    IS form. Due to how conditions are printed, MSG says what the
    desired outcome is, and CTX provides information about the
    evaluation.
    
    ```common-lisp
    (is (equal (prin1-to-string 'hello) "hello")
        :msg "Symbols are replacements for strings." 
        :ctx ("*PACKAGE* is ~S and *PRINT-CASE* is ~S~%"
              *package* *print-case*))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     Symbols are replacements for strings.
    ..   where
    ..     (PRIN1-TO-STRING 'HELLO) = "HELLO"
    ..   *PACKAGE* is # and *PRINT-CASE* is :UPCASE
    ..
    ```
    
    If CAPTURE is true, the value(s) of some subforms of FORM may be
    automatically recorded in the condition and also made available for
    CTX via *IS-CAPTURES*. See @TRY/CAPTURES for more.
    
    If PRINT-CAPTURES is true, the captures made are printed when the
    RESULT condition is displayed in the debugger or `DESCRIBE`d (see
    @TRY/PRINT). This is the `where (PRIN1-TO-STRING 'HELLO) = "HELLO"`
    part above. If PRINT-CAPTURES is NIL, the captures are still
    available in *IS-CAPTURES* for writing custom CTX messages.
    
    If RETRY is true, then the RETRY-CHECK restart evaluates FORM again
    and signals a new RESULT. If RETRY is NIL, then the RETRY-CHECK
    restart returns :RETRY, which allows complex checks such as SIGNALS
    to implement their own retry mechanism.

- [variable] *IS-FORM*

    IS binds this to its FORM argument for CTX and MSG.

- [variable] *IS-CAPTURES*

    Captures made during an IS evaluation are made available for
    CTX via *IS-CAPTURES*.

### Format Specifier Forms

A format specifier form is a Lisp form, typically an argument to
macro, standing for the FORMAT-CONTROL and FORMAT-ARGS arguments to
the FORMAT function.

It may be a constant string:

```common-lisp
(is nil :msg "FORMAT-CONTROL~%with no args.")
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     FORMAT-CONTROL
..     with no args.
```

It may be a list whose first element is a constant string, and the
rest are the format arguments to be evaluated:

```common-lisp
(is nil :msg ("Implicit LIST ~A." "form"))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     Implicit LIST form.
```

Or it may be a form that evaluates to a list like `(FORMAT-CONTROL
&REST FORMAT-ARGS)`:

```common-lisp
(is nil :msg (list "Full ~A." "form"))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     Full form.
```

Finally, it may evaluate to NIL, in which case some context specific
default is implied.

- [function] CANONICALIZE-FORMAT-SPECIFIER-FORM FORM

    Ensure that the format specifier form FORM is in its full form.

### Captures

During the evaluation of the FORM argument of IS, evaluation of any
form (e.g. a subform of FORM) may be recorded, which are called
captures.

#### Automatic Captures

IS automatically captures some subforms of FORM that are likely
to be informative. In particular, if FORM is a function call, then
non-constant arguments are automatically captured:

```common-lisp
(is (= 3 (1+ 2) (- 4 3)))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (= 3 #1=(1+ 2) #2=(- 4 3)))
..   where
..     #1# = 3
..     #2# = 1
```

By default, automatic captures are not made for subforms deeper in
FORM, except for when FORM is a call to NULL,
ENDP and NOT:

```common-lisp
(is (null (find (1+ 1) '(1 2 3))))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (NULL #1=(FIND #2=(1+ 1) '(1 2 3))))
..   where
..     #2# = 2
..     #1# = 2
```

```common-lisp
(is (endp (member (1+ 1) '(1 2 3))))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (ENDP #1=(MEMBER #2=(1+ 1) '(1 2 3))))
..   where
..     #2# = 2
..     #1# = (2 3)
```

Note that the argument of NOT is not captured as it is
assumed to be NIL or T. If that's not true, use NULL.

```common-lisp
(is (not (equal (1+ 5) 6)))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (NOT (EQUAL #1=(1+ 5) 6)))
..   where
..     #1# = 6
```

Other automatic captures are discussed with the relevant
functionality such as MATCH-VALUES.

##### Writing Automatic Capture Rules

- [class] SUB STRUCTURE-OBJECT

    A SUB (short for substitution) says that in the original form IS is
    checking, a SUBFORM was substituted (by SUBSTITUTE-IS-FORM) with
    VAR (if VALUESP is NIL) or with (VALUES-LIST VAR) if VALUESP is
    true. Conversely, VAR is to be bound to the evaluated NEW-FORM if
    VALUESP is NIL, and to (MULTIPLE-VALUE-LIST FORM) if VALUESP.
    NEW-FORM is often `EQ` to SUBFORM, but it may be different, which is
    the case when further substitutions are made within a substitution.

- [function] MAKE-SUB VAR SUBFORM NEW-FORM VALUESP

- [structure-accessor] SUB-VAR

- [structure-accessor] SUB-SUBFORM

- [structure-accessor] SUB-NEW-FORM

- [structure-accessor] SUB-VALUESP

- [generic-function] SUBSTITUTE-IS-LIST-FORM FIRST FORM ENV

    In the list FORM, whose CAR is FIRST, substitute
    subexpressions of interest with a GENSYM and return the new form. As
    the second value, return a list of SUBs.
    
    For example, consider `(IS (FIND (FOO) LIST))`. When
    SUBSTITUTE-IS-LIST-FORM is invoked on `(FIND (FOO) LIST)`, it
    substitutes each argument of FIND with a variable, returning the new
    form `(FIND TEMP1 TEMP2)` and the list of two
    substitutions `((TEMP2 (FOO) (FOO) NIL) (TEMP3 LIST LIST NIL))`.
    This allows the original form to be rewritten as
    
    ```
    (let* ((temp1 (foo))
           (temp2 list))
      (find temp1 temp2))
    ```
    
    TEMP1 and TEMP2 may then be reported in the OUTCOME condition
    signalled by IS like this:
    
        The following check failed:
          (is (find #1=(foo) #2=list))
        where
          #1# = 
          #2# = 


#### Explicit Captures

In addition to automatic captures, which are prescribed by
rewriting rules (see @TRY/WRITING-AUTOMATIC-CAPTURE-RULES),
explicit, ad-hoc captures can also be made.

```common-lisp
(is (let ((x 1))
      (= (capture x) 2)))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS
..      (LET ((X 1))
..        (= (CAPTURE X) 2)))
..   where
..     X = 1
```

If CAPTURE showing up in the form that IS prints is undesirable,
then `%` may be used instead:

```common-lisp
(is (let ((x 1))
      (= (% x) 2)))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS
..      (LET ((X 1))
..        (= X 2)))
..   where
..     X = 1
```

Multiple values may be captured with CAPTURE-VALUES and its
secretive counterpart `%%`:

```common-lisp
(is (= (%% (values 1 2)) 2))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
..   UNEXPECTED-FAILURE in check:
..     (IS (= #1=(VALUES 1 2) 2))
..   where
..     #1# == 1
..            2
```

where printing `==` instead of = indicates that this
is a multiple value capture.

- [macro] CAPTURE FORM

    Evaluate FORM, record its primary return value if within the
    dynamic extent of an IS evaluation, and finally return that value.
    If CAPTURE is used within the lexical scope of IS, then CAPTURE
    itself will show up in the form that the default MSG prints. Thus it
    is recommended to use the equivalent MACROLET `%` in the lexical
    scope as `%` is removed before printing.

- [macro] CAPTURE-VALUES FORM

    Like CAPTURE-VALUES, but record and return all values returned by
    FORM. It is recommended to use the equivalent MACROLET `%%` in the
    lexical scope as `%%` is removed before printing.

- [macrolet] % FORM

    An alias for CAPTURE in the lexical scope of IS. Removed from the
    IS form when printed.

- [macrolet] %% FORM

    An alias for CAPTURE-VALUES in the lexical scope of IS. Removed
    from the IS form when printed.

## Check Library

In the following, various checks built on top of IS are described.
Many of them share a number of arguments, which are described here.

- ON-RETURN is a boolean that determines whether the check in a
  macro that wraps BODY is made when BODY returns normally.

- ON-NLX is a boolean that determines whether the check in a macro
  that wraps BODY is made when BODY performs a @NON-LOCAL-EXIT.

- MSG and CTX are @TRY/FORMAT-SPECIFIER-FORMS as in IS.

- NAME may be provided so that it is printed (with PRIN1) instead of
  BODY in MSG.


### Checking Conditions

The macros SIGNALS, SIGNALS-NOT, INVOKES-DEBUGGER, and
INVOKES-DEBUGGER-NOT all check whether a condition of a given type,
possibly also matching a predicate, was signalled. In addition to
those already described in @TRY/CHECK-LIBRARY, these macros share a
number of arguments.

Matching conditions are those that are of type CONDITION-TYPE (not
evaluated) and satisfy the predicate PRED.

When PRED is NIL, it always matches. When it is a string, then it
matches if it is a substring of the printed representation of the
condition being handled (by PRINC under WITH-STANDARD-IO-SYNTAX).
When it is a function, it matches if it returns true when called
with the condition as its argument.

The check is performed in the cleanup form of an UNWIND-PROTECT
around BODY.

HANDLER is called when a matching condition is found. It can be a
function, T, or NIL. When it is a function, it is called from the
condition handler (SIGNALS and SIGNALS-NOT) or the debugger
hook (invokes-debugger and INVOKES-DEBUGGER-NOT) with the matching
condition. HANDLER may perform a @NON-LOCAL-EXIT. When HANDLER is T,
the matching condition is handled by performing a non-local exit to
just outside BODY. If the exit completes, BODY is treated as if it
had returned normally, and ON-RETURN is consulted. When HANDLER is
NIL, no addition action is performed when a matching condition is
found.

The default CTX describes the result of the matching process in
terms of *CONDITION-MATCHED-P* and *BEST-MATCHING-CONDITION*.

- [variable] *CONDITION-MATCHED-P*

    When a check described in @TRY/CHECKING-CONDITIONS signals its
    OUTCOME, this variable is bound to a boolean value to indicate
    whether a condition that matched CONDITION-TYPE and PRED was
    found.

- [variable] *BEST-MATCHING-CONDITION*

    Bound when a check described in @TRY/CHECKING-CONDITIONS
    signals its OUTCOME. If *CONDITION-MATCHED-P*, then it is the
    most recent condition that matched both CONDITION-TYPE and PRED.
    Else, it is the most recent condition that matched
    CONDITION-TYPE or NIL if no such conditions were detected.

- [macro] SIGNALS (CONDITION-TYPE &KEY PRED (HANDLER T) (ON-RETURN T) (ON-NLX T) NAME MSG CTX) &BODY BODY

    Check that BODY signals a CONDITION of CONDITION-TYPE (not
    evaluated) that matches PRED. To detect matching conditions, SIGNALS
    sets up a HANDLER-BIND. Thus it can only see what BODY does not
    handle. The arguments are described in @TRY/CHECKING-CONDITIONS.
    
    ```common-lisp
    (signals (error)
      (error "xxx"))
    => NIL
    ```
    
    The following example shows a failure where CONDITION-TYPE matches
    but PRED does not.
    
    ```common-lisp
    (signals (error :pred "non-matching")
      (error "xxx"))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (ERROR "xxx") signals a condition of type ERROR that matches
    ..     "non-matching".
    ..   The predicate did not match "xxx".
    ```


- [macro] SIGNALS-NOT (CONDITION-TYPE &KEY PRED (HANDLER T) (ON-RETURN T) (ON-NLX T) NAME MSG CTX) &BODY BODY

    Check that BODY does not signal a CONDITION of CONDITION-TYPE (not
    evaluated) that matches PRED. To detect matching conditions,
    SIGNALS-NOT sets up a HANDLER-BIND. Thus it can only see what BODY
    does not handle. The arguments are described in
    @TRY/CHECKING-CONDITIONS.

- [macro] INVOKES-DEBUGGER (CONDITION-TYPE &KEY PRED (HANDLER T) (ON-RETURN T) (ON-NLX T) NAME MSG CTX) &BODY BODY

    Check that BODY enters the debugger with a CONDITION of
    CONDITION-TYPE (not evaluated) that matches PRED. To detect matching
    conditions, INVOKES-DEBUGGER sets up a *DEBUGGER-HOOK*. Thus if
    *DEBUGGER-HOOK* is changed by BODY, it may not detect the condition.
    The arguments are described in @TRY/CHECKING-CONDITIONS.
    
    Note that in a trial (see CURRENT-TRIAL), all ERRORs are handled,
    and a *DEBUGGER-HOOK* is set up (see UNHANDLED-ERROR). Thus invoking
    debugger would normally cause the trial to abort.
    
    ```common-lisp
    (invokes-debugger (error :pred "xxx")
      (handler-bind ((error #'invoke-debugger))
        (error "xxx")))
    => NIL
    ```


- [macro] INVOKES-DEBUGGER-NOT (CONDITION-TYPE &KEY PRED (HANDLER T) (ON-RETURN T) (ON-NLX T) NAME MSG CTX) &BODY BODY

    Check that BODY does not enter the debugger with a CONDITION of
    CONDITION-TYPE (not evaluated) that matches PRED. To detect matching
    conditions, INVOKES-DEBUGGER-NOT sets up a *DEBUGGER-HOOK*. Thus if
    *DEBUGGER-HOOK* is changed by BODY, it may not detect the condition.
    The arguments are described in @TRY/CHECKING-CONDITIONS.

### Miscellaneous Checks

- [macro] FAILS (&KEY NAME MSG CTX) &BODY BODY

    Check that BODY performs a @NON-LOCAL-EXIT but do not cancel
    it (see @CANCELLED-NLX). See @TRY/CHECK-LIBRARY for the descriptions
    of the other arguments.
    
    In the following example, FAILS signals a SUCCESS.
    
    ```common-lisp
    (catch 'foo
      (fails ()
        (throw 'foo 7)))
    => 7
    ```
    
    Next, FAILS signals an UNEXPECTED-FAILURE because BODY returns
    normally.
    
    ```common-lisp
    (fails ()
      (print 'hey))
    ..
    .. HEY 
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (PRINT 'HEY) does not return normally.
    ```
    
    Note that there is no `FAILS-NOT` as WITH-TEST fills that role.

- [macro] IN-TIME (SECONDS &KEY (ON-RETURN T) (ON-NLX T) NAME MSG CTX) &BODY BODY

    Check that BODY finishes in SECONDS. See @TRY/CHECK-LIBRARY for
    the descriptions of the other arguments.
    
    ```
    (in-time (1)
      (sleep 2))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (SLEEP 2) finishes within 1s.
    ..   Took 2.000s.
    ```
    
    RETRY-CHECK restarts timing.

- [variable] *IN-TIME-ELAPSED-SECONDS*

    Bound to the number of seconds passed during the evaluation of
    BODY when IN-TIME signals its OUTCOME.

### Check Utilities

These utilities are not checks (which signal OUTCOMEs) but simple
functions and macros that may be useful for writing IS checks.

- [macro] ON-VALUES FORM &BODY BODY

    ON-VALUES evaluates FORM and transforms its return values one by
    one based on forms in BODY. The Nth value is replaced by the return
    value of the Nth form of BODY evaluated with `*` bound
    to the Nth value. If the number of values exceeds the number of
    transformation forms in BODY then the excess values are returned as
    is.
    
    ```common-lisp
    (on-values (values 1 "abc" 7)
      (1+ *)
      (length *))
    => 2
    => 3
    => 7
    ```
    
    If the number of values is less than the number of transformation
    forms, then in later transformation forms `*` is bound
    to NIL.
    
    ```common-lisp
    (on-values (values)
      *
      *)
    => NIL
    => NIL
    ```
    
    The first forms in BODY may be options. Options must precede
    transformation forms. With :TRUNCATE T, the excess values are
    discarded.
    
    ```common-lisp
    (on-values (values 1 "abc" 7)
      (:truncate t)
      (1+ *)
      (length *))
    => 2
    => 3
    ```
    
    The :ON-LENGTH-MISMATCH option may be NIL or a function of a single
    argument. If the number of values and the number of transformation
    forms is different, then this function is called to transform the
    list of values. :TRUNCATE is handled before :ON-LENGTH-MISMATCH.
    
    ```common-lisp
    (on-values 1
      (:on-length-mismatch (lambda (values)
                             (if (= (length values) 1)
                                 (append values '("abc"))
                                 values)))
      (1+ *)
      *)
    => 2
    => "abc"
    ```
    
    If the same option is specified multiple times, only the first one
    is in effect.

- [macro] MATCH-VALUES FORM &BODY BODY

    MATCH-VALUES returns true iff all return values of FORM satisfy
    the predicates given by BODY, which are described in ON-VALUES. The
    :TRUNCATE option of ON-VALUES is supported, but :ON-LENGTH-MISMATCH
    always returns NIL.
    
    ```common-lisp
    ;; no values
    (is (match-values (values)))
    ;; single value success
    (is (match-values 1
          (= * 1)))
    ;; success with different types
    (is (match-values (values 1 "sdf")
          (= * 1)
          (string= * "sdf")))
    ;; too few values
    (is (not (match-values 1
               (= * 1)
               (string= * "sdf"))))
    ;; too many values
    (is (not (match-values (values 1 "sdf" 3)
               (= * 1)
               (string= * "sdf"))))
    ;; too many values, but truncated
    (is (match-values (values 1 "sdf" 3)
          (:truncate t)
          (= * 1)
          (string= * "sdf")))
    ```


- [function] MISMATCH% SEQUENCE1 SEQUENCE2 &KEY FROM-END (TEST #'EQL) (START1 0) END1 (START2 0) END2 KEY MAX-PREFIX-LENGTH MAX-SUFFIX-LENGTH

    Like CL:MISMATCH but CAPTUREs and returns the common prefix and
    the mismatched suffixes. The `TEST-NOT` argument is deprecated by
    the CLHS and is not supported. In addition, if MAX-PREFIX-LENGTH and
    MAX-SUFFIX-LENGTH are non-`NIL`, they must be non-negative integers,
    and they limit the number of elements in the prefix and the
    suffixes.
    
    ```common-lisp
    (is (null (mismatch% '(1 2 3) '(1 2 4 5))))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (IS (NULL #1=(MISMATCH% '(1 2 3) '(1 2 4 5))))
    ..   where
    ..     COMMON-PREFIX = (1 2)
    ..     MISMATCHED-SUFFIX-1 = (3)
    ..     MISMATCHED-SUFFIX-2 = (4 5)
    ..     #1# = 2
    ```
    
    ```common-lisp
    (is (null (mismatch% "Hello, World!"
                         "Hello, world!")))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (IS (NULL #1=(MISMATCH% "Hello, World!" "Hello, world!")))
    ..   where
    ..     COMMON-PREFIX = "Hello, "
    ..     MISMATCHED-SUFFIX-1 = "World!"
    ..     MISMATCHED-SUFFIX-2 = "world!"
    ..     #1# = 7
    ```


- [function] DIFFERENT-ELEMENTS SEQUENCE1 SEQUENCE2 &KEY (PRED #'EQL) (MISSING :MISSING)

    Return the different elements under PRED in the given sequences as
    a list of `(:INDEX   )` elements, where `E1` and `E2`
    are elements of SEQUENCE1 and SEQUENCE2 at ``, respectively,
    and they may be MISSING if the corresponding sequence is too short.
    
    ```common-lisp
    (is (endp (different-elements '(1 2 3) '(1 b 3 d))))
    .. debugger invoked on UNEXPECTED-RESULT-FAILURE:
    ..   UNEXPECTED-FAILURE in check:
    ..     (IS (ENDP #1=(DIFFERENT-ELEMENTS '(1 2 3) '(1 B 3 D))))
    ..   where
    ..     #1# = ((:INDEX 1 2 B) (:INDEX 3 :MISSING D))
    ```


- [macro] WITH-SHUFFLING NIL &BODY BODY

    Execute the forms that make up the list of forms BODY in random
    order and return NIL. This may be useful to prevent writing tests
    that accidentally depend on the order in which subtests are called.
    
    ```common-lisp
    (loop repeat 3 do
      (with-shuffling ()
        (prin1 1)
        (prin1 2)))
    .. 122112
    => NIL
    ```


#### Comparing Floats

Float comparisons following
[https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/).

- [function] FLOAT-~= X Y &KEY (MAX-DIFF-IN-VALUE \*MAX-DIFF-IN-VALUE\*) (MAX-DIFF-IN-ULP \*MAX-DIFF-IN-ULP\*)

    Return whether two numbers, X and Y, are approximately equal either
    according to MAX-DIFF-IN-VALUE or MAX-DIFF-IN-ULP.
    
    If the absolute value of the difference of two floats is not greater
    than MAX-DIFF-IN-VALUE, then they are considered equal.
    
    If two floats are of the same sign and the number of representable
    floats (ULP, unit in the last place) between them is less than
    MAX-DIFF-IN-ULP, then they are considered equal.
    
    If neither X nor Y are floats, then the comparison is done with `=`.
    If one of them is a DOUBLE-FLOAT, then the other is converted to a
    double float, and the comparison takes place in double float space.
    Else, both are converted to SINGLE-FLOAT and the comparison takes
    place in single float space.

- [variable] *MAX-DIFF-IN-VALUE* 1.0e-16

    The default value of the MAX-DIFF-IN-VALUE argument of FLOAT-~=.

- [variable] *MAX-DIFF-IN-ULP* 2

    The default value of the MAX-DIFF-IN-ULP argument of FLOAT-~=.

- [function] FLOAT-~< X Y &KEY (MAX-DIFF-IN-VALUE \*MAX-DIFF-IN-VALUE\*) (MAX-DIFF-IN-ULP \*MAX-DIFF-IN-ULP\*)

    Return whether X is approximately less than Y. Equivalent to `<`,
    but it also allows for approximate equality according to FLOAT-~=.

- [function] FLOAT-~> X Y &KEY (MAX-DIFF-IN-VALUE \*MAX-DIFF-IN-VALUE\*) (MAX-DIFF-IN-ULP \*MAX-DIFF-IN-ULP\*)

    Return whether X is approximately greater than Y. Equivalent to `>`,
    but it also allows for approximate equality according to FLOAT-~=.

## Tests

In Try, tests are Lisp functions that record their execution in
TRIAL objects. TRIALs are to tests what function call traces are to
functions. In more detail, tests

- create a TRIAL object and signal a TRIAL-START event upon entry to
  the function,

- signal a VERDICT condition before returning normally or via a
  @NON-LOCAL-EXIT,

- return the TRIAL object as the first value,

- return explicitly returned values as the second, third, and so on
  values.

See DEFTEST and WITH-TEST for more precise descriptions.

- [macro] DEFTEST NAME LAMBDA-LIST &BODY BODY

    DEFTEST is a wrapper around DEFUN to define global test functions.
    See DEFUN for a description of NAME, LAMBDA-LIST, and BODY. The
    behaviour common with WITH-TEST is described in @TRY/TESTS.
    
    ```common-lisp
    (deftest my-test ()
      (write-string "hey"))
    => MY-TEST
    
    (test-bound-p 'my-test)
    => T
    
    (my-test)
    .. hey
    ==> #
    ```
    
    Although the common case is for tests to have no arguments, DEFTEST
    supports general function lambda lists. Within a global test,
    
    - NAME is bound to the TRIAL object
    
    - the first return value is the trial
    
    - values are not returned implicitly
    
    - values returned with an explicit RETURN-FROM are returned as
      values after the trial
    
    ```common-lisp
    (deftest my-test ()
      (prin1 my-test)
      (return-from my-test (values 2 3)))
    
    (my-test)
    .. #
    ==> #
    => 2
    => 3
    ```


- [variable] *RUN-DEFTEST-WHEN* NIL

    This may be any of :COMPILE-TOPLEVEL, :LOAD-TOPLEVEL, :EXECUTE, or
    a list thereof. The value of *RUN-DEFTEST-WHEN* determines in what
    EVAL-WHEN situation to call the test function immediately after it
    has been defined with DEFTEST.
    
    For interactive development, it may be convenient to set it to
    :EXECUTE and have the test run when the DEFTEST is evaluated (maybe
    with Slime `C-M-x`, `slime-eval-defun`). Or set it to
    :COMPILE-TOPLEVEL, and have it rerun on Slime `C-c C-c`,
    `slime-compile-defun`.
    
    If the test has required arguments, an argument list is prompted for
    and read from *QUERY-IO*.

- [function] TEST-BOUND-P SYMBOL

    See if SYMBOL names a global test (i.e. a test defined with
    DEFTEST). If since the execution of DEFTEST, the symbol has been
    uninterned, FMAKUNBOUND, or redefined with DEFUN, then it no longer
    names a global test.

- [macro] WITH-TEST (&OPTIONAL TRIAL-VAR &KEY NAME) &BODY BODY

    Define a so-called lambda test to group together CHECKs and other
    tests it executes. WITH-TEST executes BODY in its lexical
    environment even on a rerun (see @TRY/RERUN).
    
    If TRIAL-VAR is a non-`NIL` symbol, bind it to the trial object.
    NAME may be any type, it is purely for presentation purposes. If
    NAME is NIL, then it defaults to TRIAL-VAR.
    
    To facilitate returning values, a BLOCK is wrapped around BODY. The
    name of the block is TRIAL-VAR if it is a symbol, else it's NIL.
    
    When both TRIAL-VAR and NAME are specified:
    
    ```common-lisp
    (with-test (some-feature :name "obscure feature")
      (prin1 some-feature)
      (is t)
      (return-from some-feature (values 1 2)))
    .. #
    .. obscure feature
    ..   ⋅ (IS T)
    .. ⋅ obscure feature ⋅1
    ..
    ==> #
    => 1
    => 2
    ```
    
    If only TRIAL-VAR is specified:
    
    ```common-lisp
    (with-test (some-feature)
      (prin1 some-feature)
      (is t)
      (return-from some-feature (values 1 2)))
    .. #
    .. SOME-FEATURE
    ..   ⋅ (IS T)
    .. ⋅ SOME-FEATURE ⋅1
    ..
    ==> #
    => 1
    => 2
    ```
    
    If neither is specified:
    
    ```common-lisp
    (with-test ()
      (prin1 (current-trial))
      (is t)
      (return (values 1 2)))
    .. #
    .. NIL
    ..   ⋅ (IS T)
    .. ⋅ NIL ⋅1
    ..
    ==> #
    => 1
    => 2
    ```
    
    Finally, using that NAME defaults to TRIAL-VAR and that it is valid
    to specify non-symbols for TRIAL-VAR, one can also write:
    
    ```common-lisp
    (with-test ("Some feature")
      (prin1 (current-trial))
      (is t)
      (return (values 1 2)))
    .. #
    .. Some feature
    ..   ⋅ (IS T)
    .. ⋅ Some feature ⋅1
    ..
    ==> #
    => 1
    => 2
    ```
    
    In summary and in contrast to global tests (those defined with
    DEFTEST), lambda tests
    
    - have no arguments,
    
    - are defined and called at the same time,
    
    - may not bind their trial object to any variable,
    
    - may have a BLOCK named NIL,
    
    - have a NAME purely for presentation purposes.
    
    Lambda tests can be thought of as analogous to `(FUNCALL (LAMBDA ()
    BODY))`. The presence of the LAMBDA is important because it is
    stored in the TRIAL object to support @TRY/RERUN.

- [function] LIST-PACKAGE-TESTS &OPTIONAL (PACKAGE \*PACKAGE\*)

    List all symbols in PACKAGE that name global tests in the sense of
    TEST-BOUND-P.

- [macro] WITH-TESTS-RUN (TESTS-RUN) &BODY BODY

    Bind the symbol TESTS-RUN to an empty `EQ` hash table and execute
    BODY. The has table reflects call counts to global tests. Keys are
    symbols naming global tests, and the values are the number of times
    the keys have been called.

- [macro] WARN-ON-TESTS-NOT-RUN (&OPTIONAL (PACKAGE \*PACKAGE\*)) &BODY BODY

    A convenience utility to that records the global tests run by BODY
    with WITH-TESTS-RUN and, when BODY finishes, signals a warning for
    each global tests in PACKAGE not run.
    
    This is how Try runs its own tests:
    
    ```
    (defun test ()
      ;; Bind *PACKAGE* so that names of tests printed have package names,
      ;; and M-. works on them in Slime.
      (let ((*package* (find-package :common-lisp)))
        (warn-on-tests-not-run ((find-package :try))
          (print (try 'test-all
                      :print 'unexpected
                      :describe 'unexpected)))))
    ```


### Calling Test Functions

Tests can be run explicitly by invoking the TRY function or
implicitly by calling a test function:

```common-lisp
(deftest my-test ()
  (is t))

(my-test)
.. MY-TEST
..   ⋅ (IS T)
.. ⋅ MY-TEST ⋅1
..
==> #
```

The situation is similar with a WITH-TEST:

```common-lisp
(with-test (my-test)
  (is t))
.. MY-TEST
..   ⋅ (IS T)
.. ⋅ MY-TEST ⋅1
..
==> #
```

Behind the scenes, the outermost test function calls TRY with

```
(try trial :debug *debug* :collect *collect* :rerun *rerun*
     :print *print* :describe *describe*
     :stream *stream* :printer *printer*)
```

TRY then calls the test function belonging to TRIAL.
The rest of the behaviour is described in @TRY/EXPLICIT-TRY.

- [variable] *DEBUG* (AND UNEXPECTED (NOT NLX) (NOT VERDICT))

    The default value makes TRY invoke the debugger on UNHANDLED-ERROR,
    RESULT-ABORT\*, UNEXPECTED-RESULT-FAILURE, and
    UNEXPECTED-RESULT-SUCCESS. NLX is excluded because it is caught as
    the test function is being exited, but by that time the dynamic
    environment of the actual cause is likely gone. VERDICT is excluded
    because it is a consequence of its child outcomes.

- [variable] *COUNT* LEAF

    Although the default value of *CATEGORIES* lumps RESULTs and
    VERDICTs together, with the default of LEAF, VERDICTs are not
    counted.

- [variable] *COLLECT* UNEXPECTED

    To save memory, only the UNEXPECTED are collected by default.

- [variable] *RERUN* UNEXPECTED

    The default matches that of *COLLECT*.

- [variable] *PRINT* LEAF

    With the default of LEAF combined with the default *PRINT-PARENT*
    T, only TRIALs with checks or ERROR\* in them are printed. If
    UNEXPECTED, only the interesting things are printed.

- [variable] *DESCRIBE* (OR UNEXPECTED FAILURE)

    By default, the context (e.g. @TRY/CAPTURES, and the CTX argument
    of is and other checks) of UNEXPECTED events is described.

- [variable] *STREAM* (MAKE-SYNONYM-STREAM '\*DEBUG-IO\*)

- [variable] *PRINTER* TREE-PRINTER

### Explicit TRY

Instead of invoking the test function directly, tests can also be
run by invoking the TRY function.

```common-lisp
(deftest my-test ()
  (is t))

(try 'my-test)
.. MY-TEST
..   ⋅ (IS T)
.. ⋅ MY-TEST ⋅1
..
==> #
```

The situation is similar with a WITH-TEST, only that TRY wraps an
extra TRIAL around the execution of the LAMBDA to ensure that all
EVENTs are signalled within a trial.

```
(try (lambda ()
       (with-test (my-test)
         (is t))))
.. (TRY #)
..   MY-TEST
..     ⋅ (IS T)
..   ⋅ MY-TEST ⋅1
.. ⋅ (TRY #) ⋅1
..
==> #) EXPECTED-SUCCESS 0.000s ⋅1>
```

Invoking tests with an explicit TRY is very similar to just calling
the test functions directly (see @TRY/IMPLICIT-TRY). The differences
are that TRY

- can run @TRY/TESTABLES,

- has a function argument for each of the *DEBUG*, *COLLECT*, etc
  variables.

Those arguments default to *TRY-DEBUG*, *TRY-COLLECT*, etc, which
parallel and default to *DEBUG*, *COLLECT*, etc if set to
:UNSPECIFIED. *TRY-DEBUG* is NIL, the rest of them are :UNSPECIFIED.

These defaults encourage the use of an explicit TRY call in the
non-interactive case and calling the test functions directly in the
interactive one, but this is not enforced in any way.

- [function] TRY TESTABLE &KEY (DEBUG \*TRY-DEBUG\*) (COUNT \*TRY-COUNT\*) (COLLECT \*TRY-COLLECT\*) (RERUN \*TRY-RERUN\*) (PRINT \*TRY-PRINT\*) (DESCRIBE \*TRY-DESCRIBE\*) (STREAM \*TRY-STREAM\*) (PRINTER \*TRY-PRINTER\*)

    TRY runs TESTABLE and handles the EVENTs to collect, debug, print
    the results of checks and trials, and to decide what tests to skip
    and what to rerun.
    
    DEBUG, COUNT, COLLECT, RERUN, PRINT, and DESCRIBE must all be valid
    specifiers for types that are either NIL (the empty type) or have a
    non-empty intersection with the type EVENT (e.g. T, OUTCOME,
    UNEXPECTED, VERDICT).
    
    TRY sets up a HANDLER-BIND handler for EVENTs and runs TESTABLE (see
    @TRY/TESTABLES). When an EVENT is signalled, the handler matches its
    type to the value of the DEBUG argument (in the sense of `(TYPEP
    EVENT DEBUG)`). If it matches, then the debugger is invoked with the
    event. In the debugger, the user has a number of restarts available
    to change (see @TRY/EVENT-RESTARTS, @TRY/OUTCOME-RESTARTS,
    @TRY/CHECK-RESTARTS, @TRY/TRIAL-RESTARTS, and SET-TRY-DEBUG.
    
    If the debugger is not invoked, TRY invokes the very first restart
    available, which is always RECORD-EVENT.
    
    Recording the event is performed as follows.
    
    - Outcome counts are updated (see @TRY/COUNT).
    
    - The event is passed to the collector (see @TRY/COLLECT).
    
    - The event is passed to the printer (see @TRY/PRINT).
    
    - Finally, when rerunning a trial (i.e. when TESTABLE is a trial),
      on a TRIAL-START event, the trial may be skipped (see @TRY/RERUN).
    
    TRY returns the values returned by the outermost trial (see
    @TRY/TESTS).

- [function] SET-TRY-DEBUG DEBUG

    Invoke the SET-TRY-DEBUG restart to override the DEBUG argument of
    the currently running TRY. DEBUG must thus be a suitable type. When
    the SET-TRY-DEBUG restart is invoked interactively, DEBUG is read as
    a non-evaluated form from *QUERY-IO*.

- [variable] *TRY-DEBUG* NIL

    The default value for TRY's :DEBUG argument. If
    :UNSPECIFIED, then the value of *DEBUG* is used instead.

- [variable] *TRY-COUNT* :UNSPECIFIED

    The default value for TRY's :COUNT argument. If
    :UNSPECIFIED, then the value of *COUNT* is used instead.

- [variable] *TRY-COLLECT* :UNSPECIFIED

    The default value for TRY's :COLLECT argument. If
    :UNSPECIFIED, then the value of *COLLECT* is used instead.

- [variable] *TRY-RERUN* :UNSPECIFIED

    The default value for TRY's :RERUN argument. If
    :UNSPECIFIED, then the value of *RERUN* is used instead.

- [variable] *TRY-PRINT* :UNSPECIFIED

    The default value for TRY's :PRINT argument. If
    :UNSPECIFIED, then the value of *PRINT* is used instead.

- [variable] *TRY-DESCRIBE* :UNSPECIFIED

    The default value for TRY's :DESCRIBE argument. If
    :UNSPECIFIED, then the value of *DESCRIBE* is used instead.

- [variable] *TRY-STREAM* :UNSPECIFIED

    The default value for TRY's :STREAM argument. If
    :UNSPECIFIED, then the value of *STREAM* is used instead.

- [variable] *TRY-PRINTER* :UNSPECIFIED

    The default value for TRY's :PRINTER argument. If
    :UNSPECIFIED, then the value of *PRINTER* is used instead.

- [variable] *N-RECENT-TRIALS* 3

    See *RECENT-TRIALS*.

- [function] RECENT-TRIAL &OPTIONAL (N 0)

    Returns the `N`th most recent trial or NIL if there are not enough
    trials recorded. Every TRIAL returned by TRY gets pushed
    onto a list of trials, but only *N-RECENT-TRIALS* are kept.

- [variable] ! NIL

    The most recent trial. Equivalent to `(RECENT-TRIAL 0)`.

- [variable] !! NIL

    Equivalent to `(RECENT-TRIAL 1)`.

- [variable] !!! NIL

    Equivalent to `(RECENT-TRIAL 2)`.

#### Testables

Valid first arguments to TRY are called testables. A testable may
be:

- a @FUNCTION-DESIGNATOR

    - the name of a global test

    - the name of a global function

    - a function object

    - a trial

- a list of testables

- a PACKAGE

In the function designator cases, TRY calls the designated function.
TRIALs, being @FUNCALLABLE-INSTANCEs, designate themselves. If the
trial is not RUNNINGP, then it will be rerun (see @TRY/RERUN). Don't
invoke TRY with RUNNINGP trials (but see
@TRY/IMPLICIT-TRY-IMPLEMENTATION for discussion).

When given a list of testables, TRY calls each testable one by one.

Finally, a PACKAGE stands for the result of calling
LIST-PACKAGE-TESTS on that package.

#### Implementation of Implicit TRY

What's happening in the implementation is that a test function,
when it is called, checks whether it is running under the TRY
function. If it isn't, then it invokes TRY with its TRIAL. TRY
realizes the trial cannot be rerun yet (see @TRY/RERUN) because it
is RUNNINGP, sets up its event handlers for debugging, collecting,
printing, and invokes the trial as if it were rerun but without
skipping anything based on the RERUN argument. Thus the following
are infinite recursions:

```
(with-test (recurse)
  (try recurse))

(with-test (recurse)
  (funcall recurse))
```


### Printing Events

TRY instantiates a printer of the type given by its PRINTER
argument. All EVENTs recorded by TRY are sent to this printer. The
printer then prints events that match the type given by the PRINT
argument of TRY. Events that also match the DESCRIBE argument of TRY
are printed with context information (see IS) and backtraces (see
UNHANDLED-ERROR).

Although the printing is primarily customized with global special
variables, changing the value of those variables after the printer
object is instantiated by TRY has no effect. This is to ensure
consistent output with nested TRY calls of differing printer
setups.

- [class] TREE-PRINTER

    TREE-PRINTER prints events in an indented
    tree-like structure, with each internal node corresponding to a
    TRIAL. This is the default printer (according to *PRINTER* and
    *TRY-PRINTER*) and currently the only one.
    
    The following example prints all @TRY/CONCRETE-EVENTS.
    
    ```common-lisp
    (let ((*debug* nil)
          (*print* '(not trial-start))
          (*describe* nil))
      (with-test (verdict-abort*)
        (with-test (expected-verdict-success))
        (with-expected-outcome ('failure)
          (with-test (unexpected-verdict-success)))
        (handler-bind (((and verdict success) #'force-expected-failure))
          (with-test (expected-verdict-failure)))
        (handler-bind (((and verdict success) #'force-unexpected-failure))
          (with-test (unexpected-verdict-failure)))
        (with-test (verdict-skip)
          (skip-trial))
        (is t :msg "EXPECTED-RESULT-SUCCESS")
        (with-failure-expected ('failure)
          (is t :msg "UNEXPECTED-RESULT-SUCCESS")
          (is nil :msg "EXPECTED-RESULT-FAILURE"))
        (is nil :msg "UNEXPECTED-RESULT-FAILURE")
        (with-skip ()
          (is nil :msg "RESULT-SKIP"))
        (handler-bind (((and result success) #'abort-check))
          (is t :msg "RESULT-ABORT*"))
        (catch 'foo
          (with-test (nlx-test)
            (throw 'foo nil)))
        (error "UNHANDLED-ERROR")))
    .. VERDICT-ABORT*                       ; TRIAL-START
    ..   ⋅ EXPECTED-VERDICT-SUCCESS
    ..   ⊡ UNEXPECTED-VERDICT-SUCCESS
    ..   × EXPECTED-VERDICT-FAILURE
    ..   ⊠ UNEXPECTED-VERDICT-FAILURE
    ..   - VERDICT-SKIP
    ..   ⋅ EXPECTED-RESULT-SUCCESS
    ..   ⊡ UNEXPECTED-RESULT-SUCCESS
    ..   × EXPECTED-RESULT-FAILURE
    ..   ⊠ UNEXPECTED-RESULT-FAILURE
    ..   - RESULT-SKIP
    ..   ⊟ RESULT-ABORT*
    ..   NLX-TEST                           ; TRIAL-START
    ..     ⊟ non-local exit                 ; NLX
    ..   ⊟ NLX-TEST ⊟1                      ; VERDICT-ABORT*
    ..   ⊟ "UNHANDLED-ERROR" (SIMPLE-ERROR)
    .. ⊟ VERDICT-ABORT* ⊟3 ⊠1 ⊡1 -1 ×1 ⋅1
    ..
    ==> #
    ```
    
    The `⊟3 ⊠1 ⊡1 -1 ×1 ⋅1` part is the counts for *CATEGORIES* printed
    with their markers.

- [variable] *PRINT-PARENT* T

    When an EVENT is signalled and its parent TRIAL's type matches
    *PRINT-PARENT*, the trial is printed as if its TRIAL-START matched
    the PRINT argument of TRY.
    
    ```common-lisp
    (let ((*print* 'leaf)
          (*print-parent* t))
      (with-test (t0)
        (is t)
        (is t)))
    .. T0
    ..   ⋅ (IS T)
    ..   ⋅ (IS T)
    .. ⋅ T0 ⋅2
    ..
    ==> #
    ```
    
    ```common-lisp
    (let ((*print* 'leaf)
          (*print-parent* nil))
      (with-test (t0)
        (is t)
        (is t)))
    .. ⋅ (IS T)
    .. ⋅ (IS T)
    ..
    ==> #
    ```
    
    *PRINT-PARENT* NIL combined with printing VERDICTs results in a flat
     output:
    
    ```common-lisp
    (let ((*print* '(or leaf verdict))
          (*print-parent* nil))
      (with-test (outer)
        (with-test (inner)
          (is t :msg "inner-t"))
        (is t :msg "outer-t")))
    .. ⋅ inner-t
    .. ⋅ INNER ⋅1
    .. ⋅ outer-t
    .. ⋅ OUTER ⋅2
    ..
    ==> #
    ```


- [variable] *PRINT-INDENTATION* 2

    The number of spaces each printed TRIAL increases the indentation
    of its children.

- [variable] *PRINT-DURATION* NIL

    If true, the number of seconds spent during execution is printed.
    
    ```common-lisp
    (let ((*print-duration* t)
          (*debug* nil)
          (*describe* nil))
      (with-test (timed)
        (is (progn (sleep 0.3) t))
        (is (progn (sleep 0.2) t))
        (error "xxx")))
    ..        TIMED
    ..  0.300   ⋅ (IS (PROGN (SLEEP 0.3) T))
    ..  0.200   ⋅ (IS (PROGN (SLEEP 0.2) T))
    ..          ⊟ ""xxx (SIMPLE-ERROR)
    ..  0.504 ⊟ TIMED ⊟1 ⋅2
    ..
    ==> #
    ```
    
    Timing is available for all OUTCOMEs (i.e. for @TRY/CHECKS and
    TRIALs). Checks generally measure the time spent during evaluation
    the form they are wrapping. Trials measure the time between
    TRIAL-START and the VERDICT.
    
    Timing information is not available for TRIAL-START and ERROR\*
    events.

- [variable] *PRINT-COMPACTLY* NIL

    EVENTs whose type matches *PRINT-COMPACTLY* are printed less
    verbosely. LEAF events are printed only with their marker, and
    VERDICTs of trials without printed child trials are printed with `=>
    ` (see *CATEGORIES*).
    
    ```common-lisp
    (let ((*print-compactly* t)
          (*debug* nil)
          (*describe* nil))
      (with-test (outer)
        (loop repeat 10 do (is t))
        (with-test (inner)
          (is t)
          (is nil)
          (error "xxx"))
        (loop repeat 10 do (is t))))
    .. OUTER ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
    ..   INNER ⋅⊠⊟ => ⊟
    ..   ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
    .. ⊠ OUTER ⊟1 ⊠1 ⋅21
    ..
    ==> #
    ```
    
    *PRINT-COMPACTLY* has no effect on events being `DESCRIBE`d.

- [variable] *DEFER-DESCRIBE* NIL

    When an EVENT is to be `DESCRIBE`d and its type matches
    *DEFER-DESCRIBE*, then instead of printing the often longish context
    information in the tree of events, it is deferred until after TRY
    has finished. The following example only prints LEAF events (due to
    *PRINT* and *PRINT-PARENT*) and in compact form (see
    *PRINT-COMPACTLY*), deferring description of events matching
    *DESCRIBE* until the end.
    
    ```common-lisp
    (let ((*print* 'leaf)
          (*print-parent* nil)
          (*print-compactly* t)
          (*defer-describe* t)
          (*debug* nil))
      (with-test (outer)
        (loop repeat 10 do (is t))
        (with-test (inner)
          (is (= (1+ 5) 7)))))
    .. ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⊠
    ..
    .. ;; UNEXPECTED-RESULT-FAILURE (⊠) in OUTER INNER:
    .. (IS (= #1=(1+ 5) 7))
    .. where
    ..   #1# = 6
    ..
    ==> #
    ```


### Counting Events

TRIALs have a counter for each category in *CATEGORIES*. When an
EVENT is recorded by TRY and its type matches *COUNT*, the counters
of all categories matching the event type are incremented in the
CURRENT-TRIAL. When a trial finishes and a VERDICT is recorded, the
trial's event counters are added to that of its parent's (if any).
The counts are printed with VERDICTs (see @TRY/PRINT).

If both *COUNT* and *CATEGORIES* are unchanged from the their
default values, then only LEAF events are counted, and we get
separate counters for ABORT\*, UNEXPECTED-FAILURE,
UNEXPECTED-SUCCESS, SKIP, EXPECTED-FAILURE, and EXPECTED-SUCCESS.

```common-lisp
(let ((*debug* nil))
  (with-test (outer)
    (with-test (inner)
      (is t))
    (is t)
    (is nil)))
.. OUTER
..   INNER
..     ⋅ (IS T)
..   ⋅ INNER ⋅1
..   ⋅ (IS T)
..   ⊠ (IS NIL)
.. ⊠ OUTER ⊠1 ⋅2
..
==> #
```

As the above example shows, EXPECTED-VERDICT-SUCCESS and
EXPECTED-RESULT-SUCCESS are both marked with `"⋅"`, but only
EXPECTED-RESULT-SUCCESS is counted due to *COUNT* being LEAF.

### Collecting Events

When an EVENT is recorded and the type of the EVENT matches the
COLLECT type argument of TRY, then a corresponding object is pushed
onto CHILDREN of the CURRENT-TRIAL for subsequent @TRY/RERUN or
@TRY/REPLAY.

In particular, if the matching event is a LEAF, then the event
itself is collected. If the matching event is a TRIAL-EVENT, then
its TRIAL is collected. Furthermore, trials
which collected anything are always collected by their parent.

By default, both implicit and explicit calls to TRY collect the
UNEXPECTED (see *COLLECT* and *TRY-COLLECT*), and consequently all
the enclosing trials.

- [reader] CHILDREN TRIAL (:CHILDREN = NIL)

    A list of immediate child VERDICTs, RESULTs, and
    ERROR\*s collected in reverse chronological order (see
    @TRY/COLLECT). The VERDICT of this TRIAL is not among CHILDREN,
    but the VERDICTs of child trials' are.

### Rerunning Trials

When a TRIAL is `FUNCALL`ed or passed to TRY, the same tests that
instantiated TRIAL are executed.

- If the trial was created by calling a DEFTEST function, then the
  test currently associated with that symbol naming the function is
  called with the arguments of the original function call. If the
  symbol is no longer FBOUNDP (because it was FMAKUNBOUND) or it no
  longer names a DEFTEST (it was redefined with DEFUN), then an
  error is signalled.

- If the trial was created by entering a WITH-TEST form, then its
  body is executed again in the original lexical but the current
  dynamic environment. Implementationally speaking, WITH-TEST
  defines a local function of no arguments (likely a closure) that
  wraps its body, stores the closure in the trial object and calls
  it on a rerun in a WITH-TEST of the same TRIAL-VAR and same NAME.

- If the trial was created by TRY itself to ensure that all events
  are signalled in a trial (see @TRY/EXPLICIT-TRY), then on a rerun
  the same TESTABLE is run again.

All three possibilities involve entering DEFTEST or WITH-TEST, or
invoking TRY: the same cases that we have when calling tests
functions (see @TRY/IMPLICIT-TRY). Thus even if a trial is rerun
with FUNCALL, execution is guaranteed to happen under an TRY, so we
can talk about its RERUN parameter.

As the test functions are being rerun, some trials are automatically
skipped. When that happens the corresponding function call
immediately returns the TRIAL object. A new trial is skipped if

- among the collected but not yet rerun trials in the trial being
  rerun, there is no trial representing the same function call, or

- the first such trial does not match the RERUN type argument of TRY
  in that neither its TRIAL-START, VERDICT events match the type
  RERUN, nor do any of its collected RESULTs and trials.


### Reprocessing Trials

- [function] REPLAY-EVENTS TRIAL &KEY (COLLECT \*TRY-COLLECT\*) (PRINT \*TRY-PRINT\*) (DESCRIBE \*TRY-DESCRIBE\*) (STREAM \*TRY-STREAM\*) (PRINTER \*TRY-PRINTER\*)

    REPLAY-EVENTS reprocesses the events collected (see @TRY/COLLECT)
    in TRIAL. It takes the same arguments as TRY except
    DEBUG, COUNT and RERUN. This is because
    REPLAY-EVENTS does not run any tests. It simply signals the events
    collected in TRIAL again to allow further processing. The values of
    *CATEGORIES* and *COUNT* that were in effect for TRIAL are used, and
    their current values are ignored to be able to keep consistent
    counts (see @TRY/COUNT).
    
    Suppose we have run a large test using the default `:PRINT 'LEAF`
    `:COLLECT 'UNEXPECTED` arguments for TRY, and now we have too much
    output to look at. Instead of searching for the interesting bits in
    the output, we can replay the events and print only the UNEXPECTED
    events:
    
    ```
    (replay-events ! :print 'unexpected)
    ```
    
    Or we could tell the printer to just print markers for *CATEGORIES*
    and :DESCRIBE at the end:
    
    ```
    (let ((*print-parent* nil)
          (*print-compactly* t)
          (*defer-describe* t)
          (*categories* (ascii-std-categories)))
      (replay-events !))
    .. ................F................!.....
    .. 
    .. ;; UNEXPECTED-FAILURE (F) in SOME-TEST INNER-TEST:
    .. (IS (= 5 6))
    .. debug info
    .. 
    .. ;; UNHANDLED-ERROR (!) in SOME-TEST:
    .. "my-msg" (MY-ERR)
    ```


## Implementation Notes

Try is supported on ABCL, AllegroCL, CLISP, CCL, CMUCL, ECL and
SBCL.

- Pretty printing is non-existent on CLISP and broken on ABCL. The
  output may look garbled on them.

- Gray streams are broken on ABCL so the output may look even worse
  [https://abcl.org/trac/ticket/373](https://abcl.org/trac/ticket/373).

- ABCL, CMUCL, and ECL have a bug related to losing
  EQLness of source literals
  [https://gitlab.com/embeddable-common-lisp/ecl/-/issues/665](https://gitlab.com/embeddable-common-lisp/ecl/-/issues/665).
  The result is somewhat cosmetic, it may cause multiple captures
  being made for the same thing.


## Glossary

- [glossary-term] function designator

    This is a term from the Common Lisp ANSI standard. A function
    designator is a symbol (denoting the function named by that symbol
    in the global environment), or a function (denoting itself).

- [glossary-term] funcallable instance

    This is a term from the MOP. A funcallable instance is an instance
    of a class that's a subclass of `MOP:FUNCALLABLE-STANDARD-CLASS`. It
    is like a normal instance, but it can also be `FUNCALL`ed.

- [glossary-term] non-local exit

    This is a term from the Common Lisp ANSI standard. If a form does
    not return normally, but control is transferred via `GO`, RETURN,
    RETURN-FROM or THROW, then it is said to have performed a non-local
    exit.

- [glossary-term] cancelled non-local exit

    This is a term from the Common Lisp ANSI standard. If during the
    unwinding of the stack initiated by a @NON-LOCAL-EXIT another nlx is
    initiated in, and exits from an UNWIND-PROTECT cleanup form, then
    this second nlx is said to have cancelled the first, and the first
    nlx will not continue.
    
    ```common-lisp
    (catch 'foo
      (catch 'bar
        (unwind-protect
             (throw 'foo 'foo)
          (throw 'bar 'bar))))
    => BAR
    ```


* * *
###### \[generated by [MGL-PAX](https://github.com/melisgl/mgl-pax)\]


2 Systems

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


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 try

Try is a test framework.

Author

Gábor Melis

Contact

mega@retes.hu

Home Page

http://melisgl.github.io/try

Source Control

(GIT https://github.com/melisgl/try.git)

Bug Tracker

https://github.com/melisgl/try/issues

License

MIT, see COPYING.

Long Description

Try is what we get if we make tests functions and
build a test framework on top of the condition system as [Stefil](https://common-lisp.net/project/stefil/index-old.shtml) did but also address the issue of rerunning and replaying, make the IS check more capable, use the types of the condition hierarchy to parameterize what to debug, print, rerun, and finally document the whole thing.

Version

0.0.1

Defsystem Dependency

try.asdf (system).

Dependencies
  • alexandria (system).
  • closer-mop (system).
  • ieee-floats (system).
  • mgl-pax (system).
  • trivial-gray-streams (system).
  • uiop (system).
Source

try.asd.

Child Components

Previous: , Up: Systems   [Contents][Index]

2.2 try.asdf

Source

try.asdf.asd.

Child Component

asdf.lisp (file).


3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 try/try.asd

Source

try.asd.

Parent Component

try (system).

ASDF Systems

try.


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.2 try.asdf/try.asdf.asd

Source

try.asdf.asd.

Parent Component

try.asdf (system).

ASDF Systems

try.asdf.


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.3 try/package.lisp

Source

try.asd.

Parent Component

try (system).

Packages

try.


3.1.4 try/util.lisp

Dependency

package.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.5 try/gray-stream.lisp

Dependency

util.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.6 try/early.lisp

Dependency

gray-stream.lisp (file).

Source

try.asd.

Parent Component

try (system).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.7 try/debug.lisp

Dependency

early.lisp (file).

Source

try.asd.

Parent Component

try (system).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.8 try/events.lisp

Dependency

debug.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.9 try/outcome.lisp

Dependency

events.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.10 try/result.lisp

Dependency

outcome.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.11 try/is.lisp

Dependency

result.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.12 try/checks.lisp

Dependency

is.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

3.1.13 try/floats.lisp

Dependency

checks.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.14 try/trial-event.lisp

Dependency

floats.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.15 try/error.lisp

Dependency

trial-event.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.16 try/count.lisp

Dependency

error.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface

@try/count (special variable).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.17 try/trial.lisp

Dependency

count.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.18 try/test.lisp

Dependency

trial.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.19 try/testable.lisp

Dependency

test.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface

@try/testables (special variable).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.20 try/rerun.lisp

Dependency

testable.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface

@try/rerun (special variable).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.21 try/print.lisp

Dependency

rerun.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.22 try/collect.lisp

Dependency

print.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface

@try/collect (special variable).

Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.23 try/try.lisp

Dependency

collect.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.24 try/replay.lisp

Dependency

try.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.25 try/manual.lisp

Dependency

replay.lisp (file).

Source

try.asd.

Parent Component

try (system).

Public Interface
Internals

Previous: , Up: Lisp   [Contents][Index]

3.1.26 try.asdf/asdf.lisp

Source

try.asdf.asd.

Parent Component

try.asdf (system).

Packages

try/asdf.

Public Interface

compile-wrapper (function).


4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 try

Source

package.lisp.

Use List
  • common-lisp.
  • editor-hints.named-readtables.
  • mgl-pax.
  • pythonic-string-reader.
Public Interface
Internals

Previous: , Up: Packages   [Contents][Index]

4.2 try/asdf

Source

asdf.lisp.

Use List

common-lisp.

Public Interface

compile-wrapper (function).


5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.1 Special variables

Special Variable: !

The most recent trial. Equivalent to ‘(RECENT-TRIAL 0)‘.

Package

try.

Source

try.lisp.

Special Variable: !!

Equivalent to ‘(RECENT-TRIAL 1)‘.

Package

try.

Source

try.lisp.

Special Variable: !!!

Equivalent to ‘(RECENT-TRIAL 2)‘.

Package

try.

Source

try.lisp.

Special Variable: *best-matching-condition*

Bound when a check described in @TRY/CHECKING-CONDITIONS
signals its OUTCOME. If *CONDITION-MATCHED-P*, then it is the most recent condition that matched both CONDITION-TYPE and PRED. Else, it is the most recent condition that matched CONDITION-TYPE or NIL if no such conditions were detected.

Package

try.

Source

checks.lisp.

Special Variable: *categories*

A list of of elements like ‘(TYPE &KEY MARKER)‘.
When @TRY/PRINT, @TRY/CONCRETE-EVENTS are printed with the marker of the first matching type. When @TRY/COUNT, the counts associated with all matching types are incremented.

Package

try.

Source

events.lisp.

Special Variable: *collect*

To save memory, only the UNEXPECTED are collected by default.

Package

try.

Source

try.lisp.

Special Variable: *condition-matched-p*

When a check described in @TRY/CHECKING-CONDITIONS signals its OUTCOME, this variable is bound to a boolean value to indicate whether a condition that matched CONDITION-TYPE and PRED was found.

Package

try.

Source

checks.lisp.

Special Variable: *count*

Although the default value of *CATEGORIES* lumps RESULTs and VERDICTs together, with the default of LEAF, VERDICTs are not counted.

Package

try.

Source

try.lisp.

Special Variable: *debug*

The default value makes TRY invoke the debugger on UNHANDLED-ERROR, RESULT-ABORT*, UNEXPECTED-RESULT-FAILURE, and UNEXPECTED-RESULT-SUCCESS. NLX is excluded because it is caught as the test function is being exited, but by that time the dynamic environment of the actual cause is likely gone. VERDICT is excluded because it is a consequence of its child outcomes.

Package

try.

Source

try.lisp.

Special Variable: *defer-describe*

When an EVENT is to be ‘DESCRIBE‘d and its type matches *DEFER-DESCRIBE*, then instead of printing the often longish context information in the tree of events, it is deferred until after TRY has finished. The following example only prints LEAF events (due to *PRINT* and *PRINT-PARENT*) and in compact form (see *PRINT-COMPACTLY*), deferring description of events matching *DESCRIBE* until the end.

“‘cl-transcript (:dynenv try-transcript)
(let ((*print* ’leaf)
(*print-parent* nil)
(*print-compactly* t)
(*defer-describe* t)
(*debug* nil))
(with-test (outer)
(loop repeat 10 do (is t))
(with-test (inner)
(is (= (1+ 5) 7)))))
.. ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⊠
..
.. ;; UNEXPECTED-RESULT-FAILURE (⊠) in OUTER INNER:
.. (IS (= #1=(1+ 5) 7))
.. where
.. #1# = 6
..
==> #<TRIAL (WITH-TEST (OUTER)) UNEXPECTED-FAILURE 0.000s ⊠1 ⋅10> “‘

Package

try.

Source

print.lisp.

Special Variable: *describe*

By default, the context (e.g. @TRY/CAPTURES, and the CTX argument of is and other checks) of UNEXPECTED events is described.

Package

try.

Source

try.lisp.

Special Variable: *event-print-bindings*

EVENTs are conditions signalled in code that may change printer variables such as *PRINT-CIRCLE*, *PRINT-LENGTH*, etc. To control how events are printed, the list of variable bindings in *EVENT-PRINT-BINDINGS* is established whenever an EVENT is printed as if with:

“‘
(progv (mapcar #’first *event-print-bindings*)
(mapcar #’second *event-print-bindings*)
...)
“‘

The default value ensures that shared structure is recognized (see @TRY/CAPTURES). If the ‘#N#‘ syntax feels cumbersome, then change this variable.

Package

try.

Source

events.lisp.

Special Variable: *gather-backtrace*

Capturing the backtrace can be expensive. *GATHER-BACKTRACE* controls whether UNHANDLED-ERRORs shall have their BACKTRACE-OF populated.

Package

try.

Source

error.lisp.

Special Variable: *in-time-elapsed-seconds*

Bound to the number of seconds passed during the evaluation of BODY when IN-TIME signals its OUTCOME.

Package

try.

Source

checks.lisp.

Special Variable: *is-captures*

Captures made during an IS evaluation are made available for CTX via *IS-CAPTURES*.

Package

try.

Source

is.lisp.

Special Variable: *is-form*

IS binds this to its FORM argument for CTX and MSG.

Package

try.

Source

is.lisp.

Special Variable: *max-diff-in-ulp*

The default value of the MAX-DIFF-IN-ULP argument of FLOAT-~=.

Package

try.

Source

floats.lisp.

Special Variable: *max-diff-in-value*

The default value of the MAX-DIFF-IN-VALUE argument of FLOAT-~=.

Package

try.

Source

floats.lisp.

Special Variable: *n-recent-trials*

See *RECENT-TRIALS*.

Package

try.

Source

try.lisp.

Special Variable: *print*

With the default of LEAF combined with the default *PRINT-PARENT* T, only TRIALs with checks or ERROR* in them are printed. If UNEXPECTED, only the interesting things are printed.

Package

try.

Source

try.lisp.

Special Variable: *print-compactly*

EVENTs whose type matches *PRINT-COMPACTLY* are printed less verbosely. LEAF events are printed only with their marker, and VERDICTs of trials without printed child trials are printed with ‘=> <MARKER>‘ (see *CATEGORIES*).

“‘cl-transcript (:dynenv try-transcript)
(let ((*print-compactly* t)
(*debug* nil)
(*describe* nil))
(with-test (outer)
(loop repeat 10 do (is t))
(with-test (inner)
(is t)
(is nil)
(error "xxx"))
(loop repeat 10 do (is t))))
.. OUTER ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
.. INNER ⋅⊠⊟ => ⊟
.. ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
.. ⊠ OUTER ⊟1 ⊠1 ⋅21
..
==> #<TRIAL (WITH-TEST (OUTER)) UNEXPECTED-FAILURE 0.000s ⊟1 ⊠1 ⋅21> “‘

*PRINT-COMPACTLY* has no effect on events being ‘DESCRIBE‘d.

Package

try.

Source

print.lisp.

Special Variable: *print-duration*

If true, the number of seconds spent during execution is printed.

“‘cl-transcript (:check-consistency nil)
(let ((*print-duration* t)
(*debug* nil)
(*describe* nil))
(with-test (timed)
(is (progn (sleep 0.3) t))
(is (progn (sleep 0.2) t))
(error "xxx")))
.. TIMED
.. 0.300 ⋅ (IS (PROGN (SLEEP 0.3) T))
.. 0.200 ⋅ (IS (PROGN (SLEEP 0.2) T))
.. ⊟ ""xxx (SIMPLE-ERROR)
.. 0.504 ⊟ TIMED ⊟1 ⋅2
..
==> #<TRIAL (WITH-TEST (TIMED)) ABORT* 0.504s ⊟1 ⋅2>
“‘

Timing is available for all OUTCOMEs (i.e. for @TRY/CHECKS and TRIALs). Checks generally measure the time spent during evaluation the form they are wrapping. Trials measure the time between TRIAL-START and the VERDICT.

Timing information is not available for TRIAL-START and ERROR* events.

Package

try.

Source

print.lisp.

Special Variable: *print-indentation*

The number of spaces each printed TRIAL increases the indentation of its children.

Package

try.

Source

print.lisp.

Special Variable: *print-parent*

When an EVENT is signalled and its parent TRIAL’s type matches *PRINT-PARENT*, the trial is printed as if its TRIAL-START matched the PRINT argument of TRY.

“‘cl-transcript (:dynenv try-transcript)
(let ((*print* ’leaf)
(*print-parent* t))
(with-test (t0)
(is t)
(is t)))
.. T0
.. ⋅ (IS T)
.. ⋅ (IS T)
.. ⋅ T0 ⋅2
..
==> #<TRIAL (WITH-TEST (T0)) EXPECTED-SUCCESS 0.000s ⋅2>
“‘

“‘cl-transcript (:dynenv try-transcript)
(let ((*print* ’leaf)
(*print-parent* nil))
(with-test (t0)
(is t)
(is t)))
.. ⋅ (IS T)
.. ⋅ (IS T)
..
==> #<TRIAL (WITH-TEST (T0)) EXPECTED-SUCCESS 0.000s ⋅2>
“‘

*PRINT-PARENT* NIL combined with printing VERDICTs results in a flat output:

“‘cl-transcript (:dynenv try-transcript)
(let ((*print* ’(or leaf verdict))
(*print-parent* nil))
(with-test (outer)
(with-test (inner)
(is t :msg "inner-t"))
(is t :msg "outer-t")))
.. ⋅ inner-t
.. ⋅ INNER ⋅1
.. ⋅ outer-t
.. ⋅ OUTER ⋅2
..
==> #<TRIAL (WITH-TEST (OUTER)) EXPECTED-SUCCESS 0.000s ⋅2> “‘

Package

try.

Source

print.lisp.

Special Variable: *printer*
Package

try.

Source

try.lisp.

Special Variable: *rerun*

The default matches that of *COLLECT*.

Package

try.

Source

try.lisp.

Special Variable: *run-deftest-when*

This may be any of :COMPILE-TOPLEVEL, :LOAD-TOPLEVEL, :EXECUTE, or a list thereof. The value of *RUN-DEFTEST-WHEN* determines in what EVAL-WHEN situation to call the test function immediately after it has been defined with DEFTEST.

For interactive development, it may be convenient to set it to :EXECUTE and have the test run when the DEFTEST is evaluated (maybe with Slime ‘C-M-x‘, ‘slime-eval-defun‘). Or set it to :COMPILE-TOPLEVEL, and have it rerun on Slime ‘C-c C-c‘, ‘slime-compile-defun‘.

If the test has required arguments, an argument list is prompted for and read from *QUERY-IO*.

Package

try.

Source

test.lisp.

Special Variable: *stream*
Package

try.

Source

try.lisp.

Special Variable: *try-collect*

The default value for TRY’s :COLLECT argument. If :UNSPECIFIED, then the value of *COLLECT* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-count*

The default value for TRY’s :COUNT argument. If :UNSPECIFIED, then the value of *COUNT* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-debug*

The default value for TRY’s :DEBUG argument. If :UNSPECIFIED, then the value of *DEBUG* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-describe*

The default value for TRY’s :DESCRIBE argument. If :UNSPECIFIED, then the value of *DESCRIBE* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-print*

The default value for TRY’s :PRINT argument. If :UNSPECIFIED, then the value of *PRINT* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-printer*

The default value for TRY’s :PRINTER argument. If :UNSPECIFIED, then the value of *PRINTER* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-rerun*

The default value for TRY’s :RERUN argument. If :UNSPECIFIED, then the value of *RERUN* is used instead.

Package

try.

Source

try.lisp.

Special Variable: *try-stream*

The default value for TRY’s :STREAM argument. If :UNSPECIFIED, then the value of *STREAM* is used instead.

Package

try.

Source

try.lisp.

Special Variable: @try-manual
Package

try.

Source

manual.lisp.

Special Variable: @try/automatic-captures
Package

try.

Source

is.lisp.

Special Variable: @try/captures
Package

try.

Source

is.lisp.

Special Variable: @try/categories
Package

try.

Source

events.lisp.

Special Variable: @try/check-library
Package

try.

Source

checks.lisp.

Special Variable: @try/check-restarts
Package

try.

Source

outcome.lisp.

Special Variable: @try/check-utilities
Package

try.

Source

checks.lisp.

Special Variable: @try/checking-conditions
Package

try.

Source

checks.lisp.

Special Variable: @try/checks
Package

try.

Source

outcome.lisp.

Special Variable: @try/collect
Package

try.

Source

collect.lisp.

Special Variable: @try/comparing-floats
Package

try.

Source

floats.lisp.

Special Variable: @try/concrete-events
Package

try.

Source

events.lisp.

Special Variable: @try/count
Package

try.

Source

count.lisp.

Special Variable: @try/errors
Package

try.

Source

error.lisp.

Special Variable: @try/event-glue
Package

try.

Source

events.lisp.

Special Variable: @try/event-restarts
Package

try.

Source

events.lisp.

Special Variable: @try/events
Package

try.

Source

events.lisp.

Special Variable: @try/explicit-captures
Package

try.

Source

is.lisp.

Special Variable: @try/explicit-try
Package

try.

Source

try.lisp.

Special Variable: @try/format-specifier-forms
Package

try.

Source

is.lisp.

Special Variable: @try/glossary
Package

try.

Source

manual.lisp.

Special Variable: @try/implementation-notes
Package

try.

Source

manual.lisp.

Special Variable: @try/implicit-try
Package

try.

Source

try.lisp.

Special Variable: @try/implicit-try-implementation
Package

try.

Source

try.lisp.

Special Variable: @try/is
Package

try.

Source

is.lisp.

Package

try.

Source

manual.lisp.

Special Variable: @try/middle-layer-of-events
Package

try.

Source

events.lisp.

Special Variable: @try/misc-checks
Package

try.

Source

checks.lisp.

Special Variable: @try/outcome-restarts
Package

try.

Source

outcome.lisp.

Special Variable: @try/outcomes
Package

try.

Source

outcome.lisp.

Special Variable: @try/print
Package

try.

Source

print.lisp.

Special Variable: @try/printing-events
Package

try.

Source

events.lisp.

Special Variable: @try/replay
Package

try.

Source

replay.lisp.

Special Variable: @try/rerun
Package

try.

Source

rerun.lisp.

Special Variable: @try/testables
Package

try.

Source

testable.lisp.

Special Variable: @try/tests
Package

try.

Source

test.lisp.

Special Variable: @try/trial-events
Package

try.

Source

trial-event.lisp.

Special Variable: @try/trial-restarts
Package

try.

Source

trial.lisp.

Special Variable: @try/trial-verdicts
Package

try.

Source

trial.lisp.

Special Variable: @try/trials
Package

try.

Source

trial.lisp.

Special Variable: @try/tutorial
Package

try.

Source

manual.lisp.

Special Variable: @try/writing-automatic-capture-rules
Package

try.

Source

is.lisp.


5.1.2 Macros

Macro: capture (form)

Evaluate FORM, record its primary return value if within the dynamic extent of an IS evaluation, and finally return that value. If CAPTURE is used within the lexical scope of IS, then CAPTURE itself will show up in the form that the default MSG prints. Thus it is recommended to use the equivalent MACROLET ‘%‘ in the lexical scope as ‘%‘ is removed before printing.

Package

try.

Source

is.lisp.

Macro: capture-values (form)

Like CAPTURE-VALUES, but record and return all values returned by FORM. It is recommended to use the equivalent MACROLET ‘%%‘ in the lexical scope as ‘%%‘ is removed before printing.

Package

try.

Source

is.lisp.

Macro: deftest (name lambda-list &body body)

DEFTEST is a wrapper around DEFUN to define global test functions. See DEFUN for a description of NAME, LAMBDA-LIST, and BODY. The behaviour common with WITH-TEST is described in @TRY/TESTS.

“‘cl-transcript (:dynenv try-transcript)
(deftest my-test ()
(write-string "hey"))
=> MY-TEST

(test-bound-p ’my-test)
=> T

(my-test)
.. hey
==> #<TRIAL (MY-TEST) EXPECTED-SUCCESS 0.000s>
“‘

Although the common case is for tests to have no arguments, DEFTEST supports general function lambda lists. Within a global test,

- NAME is bound to the TRIAL object

- the first return value is the trial

- values are not returned implicitly

- values returned with an explicit RETURN-FROM are returned as values after the trial

“‘cl-transcript (:dynenv try-transcript)
(deftest my-test ()
(prin1 my-test)
(return-from my-test (values 2 3)))

(my-test)
.. #<TRIAL (MY-TEST) RUNNING>
==> #<TRIAL (MY-TEST) EXPECTED-SUCCESS 0.000s>
=> 2
=> 3
“‘

Package

try.

Source

test.lisp.

Macro: fails ((&key name msg ctx) &body body)

Check that BODY performs a @NON-LOCAL-EXIT but do not cancel
it (see @CANCELLED-NLX). See @TRY/CHECK-LIBRARY for the descriptions of the other arguments.

In the following example, FAILS signals a SUCCESS.

“‘cl-transcript (:dynenv try-transcript)
(catch ’foo
(fails ()
(throw ’foo 7)))
=> 7
“‘

Next, FAILS signals an UNEXPECTED-FAILURE because BODY returns normally.

“‘cl-transcript (:dynenv try-transcript)
(fails ()
(print ’hey))
..
.. HEY
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (PRINT ’HEY) does not return normally.
“‘

Note that there is no ‘FAILS-NOT‘ as WITH-TEST fills that role.

Package

try.

Source

checks.lisp.

Macro: in-time ((seconds &key on-return on-nlx name msg ctx) &body body)

Check that BODY finishes in SECONDS. See @TRY/CHECK-LIBRARY for the descriptions of the other arguments.

“‘
(in-time (1)
(sleep 2))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (SLEEP 2) finishes within 1s.
.. Took 2.000s.
“‘

RETRY-CHECK restarts timing.

Package

try.

Source

checks.lisp.

Macro: invokes-debugger ((condition-type &key pred handler on-return on-nlx name msg ctx) &body body)

Check that BODY enters the debugger with a CONDITION of CONDITION-TYPE (not evaluated) that matches PRED. To detect matching conditions, INVOKES-DEBUGGER sets up a *DEBUGGER-HOOK*. Thus if *DEBUGGER-HOOK* is changed by BODY, it may not detect the condition. The arguments are described in @TRY/CHECKING-CONDITIONS.

Note that in a trial (see CURRENT-TRIAL), all ERRORs are handled, and a *DEBUGGER-HOOK* is set up (see UNHANDLED-ERROR). Thus invoking debugger would normally cause the trial to abort.

“‘cl-transcript (:dynenv try-transcript)
(invokes-debugger (error :pred "xxx")
(handler-bind ((error #’invoke-debugger))
(error "xxx")))
=> NIL
“‘

Package

try.

Source

checks.lisp.

Macro: invokes-debugger-not ((condition-type &key pred handler on-return on-nlx name msg ctx) &body body)

Check that BODY does not enter the debugger with a CONDITION of CONDITION-TYPE (not evaluated) that matches PRED. To detect matching conditions, INVOKES-DEBUGGER-NOT sets up a *DEBUGGER-HOOK*. Thus if *DEBUGGER-HOOK* is changed by BODY, it may not detect the condition. The arguments are described in @TRY/CHECKING-CONDITIONS.

Package

try.

Source

checks.lisp.

Macro: is (form &key msg ctx capture print-captures retry)

Evaluate FORM and signal a RESULT SUCCESS if its first return value is not NIL, else signal a RESULT FAILURE (see @TRY/OUTCOMES). IS returns normally if

- the RECORD-EVENT restart is invoked (available when running in a trial), or
- the CONTINUE restart is invoked (available when not running in a trial), or
- the signalled RESULT condition is not handled (possible only when not running in a trial, and the result is a PASS).

The return value of IS is T if the last condition signalled is a SUCCESS, and NIL otherwise.

MSG and CTX are @TRY/FORMAT-SPECIFIER-FORMS. MSG prints a description of the check being made, which is by default the whole IS form. Due to how conditions are printed, MSG says what the desired outcome is, and CTX provides information about the evaluation.

“‘cl-transcript (:check-consistency #+sbcl t #-sbcl nil)
(is (equal (prin1-to-string ’hello) "hello")
:msg "Symbols are replacements for strings."
:ctx ("*PACKAGE* is ~S and *PRINT-CASE* is ~S~%"
*package* *print-case*))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. Symbols are replacements for strings.
.. where
.. (PRIN1-TO-STRING ’HELLO) = "HELLO"
.. *PACKAGE* is #<PACKAGE "TRY"> and *PRINT-CASE* is :UPCASE ..
“‘

If CAPTURE is true, the value(s) of some subforms of FORM may be automatically recorded in the condition and also made available for CTX via *IS-CAPTURES*. See @TRY/CAPTURES for more.

If PRINT-CAPTURES is true, the captures made are printed when the RESULT condition is displayed in the debugger or ‘DESCRIBE‘d (see @TRY/PRINT). This is the ‘where (PRIN1-TO-STRING ’HELLO) = "HELLO"‘ part above. If PRINT-CAPTURES is NIL, the captures are still available in *IS-CAPTURES* for writing custom CTX messages.

If RETRY is true, then the RETRY-CHECK restart evaluates FORM again and signals a new RESULT. If RETRY is NIL, then the RETRY-CHECK restart returns :RETRY, which allows complex checks such as SIGNALS to implement their own retry mechanism.

Package

try.

Source

is.lisp.

Macro: match-values (form &body body)

MATCH-VALUES returns true iff all return values of FORM satisfy the predicates given by BODY, which are described in ON-VALUES. The :TRUNCATE option of ON-VALUES is supported, but :ON-LENGTH-MISMATCH always returns NIL.

“‘cl-transcript (:dynenv try-transcript)
;; no values
(is (match-values (values)))
;; single value success
(is (match-values 1
(= * 1)))
;; success with different types
(is (match-values (values 1 "sdf")
(= * 1)
(string= * "sdf")))
;; too few values
(is (not (match-values 1
(= * 1)
(string= * "sdf"))))
;; too many values
(is (not (match-values (values 1 "sdf" 3)
(= * 1)
(string= * "sdf"))))
;; too many values, but truncated
(is (match-values (values 1 "sdf" 3)
(:truncate t)
(= * 1)
(string= * "sdf")))
“‘

Package

try.

Source

checks.lisp.

Macro: on-values (form &body body)

ON-VALUES evaluates FORM and transforms its return values one by one based on forms in BODY. The Nth value is replaced by the return value of the Nth form of BODY evaluated with [‘*‘][dislocated] bound to the Nth value. If the number of values exceeds the number of transformation forms in BODY then the excess values are returned as is.

“‘cl-transcript
(on-values (values 1 "abc" 7)
(1+ *)
(length *))
=> 2
=> 3
=> 7
“‘

If the number of values is less than the number of transformation forms, then in later transformation forms [‘*‘][dislocated] is bound to NIL.

“‘cl-transcript
(on-values (values)
*
*)
=> NIL
=> NIL
“‘

The first forms in BODY may be options. Options must precede transformation forms. With :TRUNCATE T, the excess values are discarded.

“‘cl-transcript
(on-values (values 1 "abc" 7)
(:truncate t)
(1+ *)
(length *))
=> 2
=> 3
“‘

The :ON-LENGTH-MISMATCH option may be NIL or a function of a single argument. If the number of values and the number of transformation forms is different, then this function is called to transform the list of values. :TRUNCATE is handled before :ON-LENGTH-MISMATCH.

“‘cl-transcript
(on-values 1
(:on-length-mismatch (lambda (values)
(if (= (length values) 1)
(append values ’("abc")) values)))
(1+ *)
*)
=> 2
=> "abc"
“‘

If the same option is specified multiple times, only the first one is in effect.

Package

try.

Source

util.lisp.

Macro: signals ((condition-type &key pred handler on-return on-nlx name msg ctx) &body body)

Check that BODY signals a CONDITION of CONDITION-TYPE (not evaluated) that matches PRED. To detect matching conditions, SIGNALS sets up a HANDLER-BIND. Thus it can only see what BODY does not handle. The arguments are described in @TRY/CHECKING-CONDITIONS.

“‘cl-transcript (:dynenv try-transcript)
(signals (error)
(error "xxx"))
=> NIL
“‘

The following example shows a failure where CONDITION-TYPE matches but PRED does not.

“‘cl-transcript (:dynenv try-transcript)
(signals (error :pred "non-matching")
(error "xxx"))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (ERROR "xxx") signals a condition of type ERROR that matches .. "non-matching".
.. The predicate did not match "xxx".
“‘

Package

try.

Source

checks.lisp.

Macro: signals-not ((condition-type &key pred handler on-return on-nlx name msg ctx) &body body)

Check that BODY does not signal a CONDITION of CONDITION-TYPE (not evaluated) that matches PRED. To detect matching conditions, SIGNALS-NOT sets up a HANDLER-BIND. Thus it can only see what BODY does not handle. The arguments are described in @TRY/CHECKING-CONDITIONS.

Package

try.

Source

checks.lisp.

Macro: warn-on-tests-not-run ((&optional package) &body body)

A convenience utility to that records the global tests run by BODY with WITH-TESTS-RUN and, when BODY finishes, signals a warning for each global tests in PACKAGE not run.

This is how Try runs its own tests:

“‘
(defun test ()
;; Bind *PACKAGE* so that names of tests printed have package names, ;; and M-. works on them in Slime.
(let ((*package* (find-package :common-lisp))) (warn-on-tests-not-run ((find-package :try))
(print (try ’test-all
:print ’unexpected
:describe ’unexpected)))))
“‘

Package

try.

Source

test.lisp.

Macro: with-expected-outcome ((expected-type) &body body)

When an OUTCOME is to be signalled, EXPECTED-TYPE determines
whether it’s going to be EXPECTED. The concrete OUTCOME classes are ‘{EXPECTED,UNEXPECTED}-{RESULT,VERDICT}-{SUCCESS,FAILURE}‘ (see @TRY/EVENTS), of which RESULT or VERDICT and SUCCESS or FAILURE are already known. If a RESULT FAILURE is to be signalled, then the
moral equivalent of ‘(SUBTYPEP ’(AND RESULT FAILURE) EXPECTED-TYPE)‘
is evaluated and depending on whether it’s true, EXPECTED-RESULT-FAILURE or UNEXPECTED-RESULT-FAILURE is signalled.

By default, SUCCESS is expected. The following example shows how to expect both SUCCESS and FAILURE for RESULTs, while requiring
VERDICTs to succeed:

“‘cl-transcript (:dynenv try-transcript)
(let ((*debug* nil))
(with-expected-outcome (’(or result (and verdict success))) (with-test (t1)
(is nil))))
.. T1
.. × (IS NIL)
.. ⋅ T1 ×1
..
==> #<TRIAL (WITH-TEST (T1)) EXPECTED-SUCCESS 0.000s ×1>
“‘

This is equivalent to ‘(WITH-FAILURE-EXPECTED () ...)‘. To make
result failures expected but result successes unexpected:

“‘cl-transcript (:dynenv try-transcript)
(let ((*debug* nil))
(with-expected-outcome (’(or (and result failure) (and verdict success))) (with-test (t1)
(is t)
(is nil))))
.. T1
.. ⊡ (IS T)
.. × (IS NIL)
.. ⋅ T1 ⊡1 ×1
..
==> #<TRIAL (WITH-TEST (T1)) EXPECTED-SUCCESS 0.000s ⊡1 ×1>
“‘

This is equivalent to ‘(WITH-FAILURE-EXPECTED (’FAILURE) ...)‘. The final example leaves result failures unexpected but makes both
verdict successes and failures expected:

“‘cl-transcript (:dynenv try-transcript)
(let ((*debug* nil))
(with-expected-outcome (’(or (and result success) verdict)) (with-test (t1)
(is nil))))
.. T1
.. ⊠ (IS NIL)
.. × T1 ⊠1
..
==> #<TRIAL (WITH-TEST (T1)) EXPECTED-FAILURE 0.004s ⊠1>
“‘

Package

try.

Source

outcome.lisp.

Macro: with-failure-expected ((&optional result-expected-type verdict-expected-type) &body body)

A convenience macro on top of WITH-EXPECTED-OUTCOME, WITH-FAILURE-EXPECTED expects VERDICTs to have VERDICT-EXPECTED-TYPE and RESULTs to have RESULT-EXPECTED-TYPE. A simple ‘(WITH-FAILURE-EXPECTED () ...)‘ makes all RESULT ‘SUCCESS‘es and FAILUREs EXPECTED. ‘(WITH-FAILURE-EXPECTED (’FAILURE) ..)‘ expects FAILUREs only, and any ‘SUCCESS‘es will be UNEXPECTED.

Package

try.

Source

outcome.lisp.

Macro: with-shuffling (() &body body)

Execute the forms that make up the list of forms BODY in random order and return NIL. This may be useful to prevent writing tests that accidentally depend on the order in which subtests are called.

“‘cl-transcript (:check-consistency nil)
(loop repeat 3 do
(with-shuffling ()
(prin1 1)
(prin1 2)))
.. 122112
=> NIL
“‘

Package

try.

Source

checks.lisp.

Macro: with-skip ((&optional skip) &body body)

WITH-SKIP skips checks and trials. It forces an immediate SKIP-TRIAL whenever a trial is started (which turns into a VERDICT-SKIP) and makes checks (without intervening trials, of course) evaluate normally but signal RESULT-SKIP. SKIP is NIL cancels the effect of any enclosing WITH-SKIP with SKIP true.

Package

try.

Source

outcome.lisp.

Macro: with-test ((&optional trial-var &key name) &body body)

Define a so-called lambda test to group together CHECKs and other tests it executes. WITH-TEST executes BODY in its lexical environment even on a rerun (see @TRY/RERUN).

If TRIAL-VAR is a non-‘NIL‘ symbol, bind it to the trial object. NAME may be any type, it is purely for presentation purposes. If NAME is NIL, then it defaults to TRIAL-VAR.

To facilitate returning values, a BLOCK is wrapped around BODY. The name of the block is TRIAL-VAR if it is a symbol, else it’s NIL.

When both TRIAL-VAR and NAME are specified:

“‘cl-transcript (:dynenv try-transcript)
(with-test (some-feature :name "obscure feature")
(prin1 some-feature)
(is t)
(return-from some-feature (values 1 2)))
.. #<TRIAL (WITH-TEST ("obscure feature")) RUNNING>
.. obscure feature
.. ⋅ (IS T)
.. ⋅ obscure feature ⋅1
..
==> #<TRIAL (WITH-TEST ("obscure feature")) EXPECTED-SUCCESS 0.002s ⋅1> => 1
=> 2
“‘

If only TRIAL-VAR is specified:

“‘cl-transcript (:dynenv try-transcript)
(with-test (some-feature)
(prin1 some-feature)
(is t)
(return-from some-feature (values 1 2)))
.. #<TRIAL (WITH-TEST (SOME-FEATURE)) RUNNING>
.. SOME-FEATURE
.. ⋅ (IS T)
.. ⋅ SOME-FEATURE ⋅1
..
==> #<TRIAL (WITH-TEST (SOME-FEATURE)) EXPECTED-SUCCESS 0.000s ⋅1> => 1
=> 2
“‘

If neither is specified:

“‘cl-transcript (:dynenv try-transcript)
(with-test ()
(prin1 (current-trial))
(is t)
(return (values 1 2)))
.. #<TRIAL (WITH-TEST (NIL)) RUNNING>
.. NIL
.. ⋅ (IS T)
.. ⋅ NIL ⋅1
..
==> #<TRIAL (WITH-TEST (NIL)) EXPECTED-SUCCESS 0.000s ⋅1>
=> 1
=> 2
“‘

Finally, using that NAME defaults to TRIAL-VAR and that it is valid to specify non-symbols for TRIAL-VAR, one can also write:

“‘cl-transcript (:dynenv try-transcript)
(with-test ("Some feature")
(prin1 (current-trial))
(is t)
(return (values 1 2)))
.. #<TRIAL (WITH-TEST ("Some feature")) RUNNING>
.. Some feature
.. ⋅ (IS T)
.. ⋅ Some feature ⋅1
..
==> #<TRIAL (WITH-TEST ("Some feature")) EXPECTED-SUCCESS 0.000s ⋅1> => 1
=> 2
“‘

In summary and in contrast to global tests (those defined with DEFTEST), lambda tests

- have no arguments,
- are defined and called at the same time,
- may not bind their trial object to any variable,
- may have a BLOCK named NIL,
- have a NAME purely for presentation purposes.

Lambda tests can be thought of as analogous to ‘(FUNCALL (LAMBDA () BODY))‘. The presence of the LAMBDA is important because it is stored in the TRIAL object to support @TRY/RERUN.

Package

try.

Source

test.lisp.

Macro: with-tests-run ((tests-run) &body body)

Bind the symbol TESTS-RUN to an empty ‘EQ‘ hash table and execute BODY. The has table reflects call counts to global tests. Keys are symbols naming global tests, and the values are the number of times the keys have been called.

Package

try.

Source

test.lisp.


5.1.3 Ordinary functions

Function: abort-check (&optional condition)

Change the OUTCOME of the check being signalled to ‘RESULT-ABORT*‘. ‘RESULT-ABORT*‘, being ‘(NOT PASS)‘, will cause the check to return NIL if RECORD-EVENT is invoked on it.

Package

try.

Source

outcome.lisp.

Function: abort-trial (&optional condition trial)

Invoke the ABORT-TRIAL restart of a RUNNINGP TRIAL.

When CONDITION is a VERDICT for TRIAL, ABORT-TRIAL signals a new verdict of type VERDICT-ABORT*. This behavior is similar to that of ABORT-CHECK. Else, the ABORT-TRIAL restart may record CONDITION, then it initiates a @NON-LOCAL-EXIT to return from the test function with VERDICT-ABORT*. If during the unwinding SKIP-TRIAL or RETRY-TRIAL is called, then the abort is cancelled.

Since ABORT* is an UNEXPECTED EVENT, ABORT-TRIAL is rarely used programatically. Signalling any error in a trial that’s not caught before the trial’s handler catches it will get turned into an UNHANDLED-ERROR, and TRY will invoke ABORT-TRIAL with it. Thus, instead of invoking ABORT-TRIAL directly, signalling an error will often suffice.

Package

try.

Source

trial.lisp.

Function: ascii-std-categories ()

Returns a value suitable for *CATEGORIES*, which uses only ASCII characters for the markers.

“‘
’((abort* :marker "!")
(unexpected-failure :marker "F")
(unexpected-success :marker ":")
(skip :marker "-")
(expected-failure :marker "f")
(expected-success :marker "."))
“‘

Package

try.

Source

events.lisp.

Function: canonicalize-format-specifier-form (form)

Ensure that the format specifier form FORM is in its full form.

Package

try.

Source

is.lisp.

Function: compile-wrapper (continuation)
Package

try/asdf.

Source

asdf.lisp.

Function: current-trial ()

TRIALs, like the calls to tests they stand for, nest. CURRENT-TRIAL returns the innermost trial. If there is no currently running test, then an error is signalled. The returned trial is RUNNINGP.

Package

try.

Source

trial.lisp.

Function: different-elements (sequence1 sequence2 &key pred missing)

Return the different elements under PRED in the given sequences as a list of ‘(:INDEX <INDEX> <E1> <E2>)‘ elements, where ‘E1‘ and ‘E2‘ are elements of SEQUENCE1 and SEQUENCE2 at ‘<INDEX>‘, respectively, and they may be MISSING if the corresponding sequence is too short.

“‘cl-transcript (:dynenv try-transcript)
(is (endp (different-elements ’(1 2 3) ’(1 b 3 d))))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (IS (ENDP #1=(DIFFERENT-ELEMENTS ’(1 2 3) ’(1 B 3 D)))) .. where
.. #1# = ((:INDEX 1 2 B) (:INDEX 3 :MISSING D))
“‘

Package

try.

Source

checks.lisp.

Function: failedp (trial)

See if TRIAL has finished and its [VERDICT][(reader trial)] is a FAIL.

Package

try.

Source

trial.lisp.

Function: fancy-std-categories ()

Returns the default value of *CATEGORIES* (see @TRY/CATEGORIES), which contains some fancy Unicode characters.

Package

try.

Source

events.lisp.

Function: float-~< (x y &key max-diff-in-value max-diff-in-ulp)

Return whether X is approximately less than Y. Equivalent to ‘<‘, but it also allows for approximate equality according to FLOAT-~=.

Package

try.

Source

floats.lisp.

Function: float-~= (x y &key max-diff-in-value max-diff-in-ulp)

Return whether two numbers, X and Y, are approximately equal either according to MAX-DIFF-IN-VALUE or MAX-DIFF-IN-ULP.

If the absolute value of the difference of two floats is not greater than MAX-DIFF-IN-VALUE, then they are considered equal.

If two floats are of the same sign and the number of representable floats (ULP, unit in the last place) between them is less than MAX-DIFF-IN-ULP, then they are considered equal.

If neither X nor Y are floats, then the comparison is done with ‘=‘. If one of them is a DOUBLE-FLOAT, then the other is converted to a double float, and the comparison takes place in double float space. Else, both are converted to SINGLE-FLOAT and the comparison takes place in single float space.

Package

try.

Source

floats.lisp.

Function: float-~> (x y &key max-diff-in-value max-diff-in-ulp)

Return whether X is approximately greater than Y. Equivalent to ‘>‘, but it also allows for approximate equality according to FLOAT-~=.

Package

try.

Source

floats.lisp.

Function: force-expected-failure (&optional condition)

Change the type of OUTCOME being signalled to EXPECTED and FAILURE.

Package

try.

Source

outcome.lisp.

Function: force-expected-success (&optional condition)

Change the type of the OUTCOME being signalled to EXPECTED and SUCCESS. If the original condition is a RESULT, then this will be EXPECTED-RESULT-SUCCESS, if it is a VERDICT, then EXPECTED-VERDICT-SUCCESS.

Package

try.

Source

outcome.lisp.

Function: force-unexpected-failure (&optional condition)

Change the type of OUTCOME being signalled to UNEXPECTED and FAILURE.

Package

try.

Source

outcome.lisp.

Function: force-unexpected-success (&optional condition)

Change the type of OUTCOME being signalled to UNEXPECTED and SUCCESS.

Package

try.

Source

outcome.lisp.

Function: list-package-tests (&optional package)

List all symbols in PACKAGE that name global tests in the sense of TEST-BOUND-P.

Package

try.

Source

test.lisp.

Function: make-sub (var subform new-form valuesp)
Package

try.

Source

is.lisp.

Function: mismatch% (sequence1 sequence2 &key from-end test start1 end1 start2 end2 key max-prefix-length max-suffix-length)

Like CL:MISMATCH but CAPTUREs and returns the common prefix and the mismatched suffixes. The ‘TEST-NOT‘ argument is deprecated by the CLHS and is not supported. In addition, if MAX-PREFIX-LENGTH and MAX-SUFFIX-LENGTH are non-‘NIL‘, they must be non-negative integers, and they limit the number of elements in the prefix and the suffixes.

“‘cl-transcript (:dynenv try-transcript)
(is (null (mismatch% ’(1 2 3) ’(1 2 4 5))))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (IS (NULL #1=(MISMATCH% ’(1 2 3) ’(1 2 4 5))))
.. where
.. COMMON-PREFIX = (1 2)
.. MISMATCHED-SUFFIX-1 = (3)
.. MISMATCHED-SUFFIX-2 = (4 5)
.. #1# = 2
“‘

“‘cl-transcript (:dynenv try-transcript)
(is (null (mismatch% "Hello, World!"
"Hello, world!")))
.. debugger invoked on UNEXPECTED-RESULT-FAILURE:
.. UNEXPECTED-FAILURE in check:
.. (IS (NULL #1=(MISMATCH% "Hello, World!" "Hello, world!"))) .. where
.. COMMON-PREFIX = "Hello, "
.. MISMATCHED-SUFFIX-1 = "World!"
.. MISMATCHED-SUFFIX-2 = "world!"
.. #1# = 7
“‘

Package

try.

Source

checks.lisp.

Function: passedp (trial)

See if TRIAL has finished and its [VERDICT][(reader trial)] is a PASS.

Package

try.

Source

trial.lisp.

Function: recent-trial (&optional n)

Returns the ‘N‘th most recent trial or NIL if there are not enough trials recorded. Every TRIAL returned by TRY gets pushed onto a list of trials, but only *N-RECENT-TRIALS* are kept.

Package

try.

Source

try.lisp.

Function: record-event (&optional condition)

This restart is always the first restart available when an EVENT is signalled running under TRY (i.e. there is a CURRENT-TRIAL). TRY always invokes RECORD-EVENT when handling events.

Package

try.

Source

events.lisp.

Function: replay-events (trial &key collect print describe stream printer)

REPLAY-EVENTS reprocesses the events collected (see @TRY/COLLECT) in TRIAL. It takes the same arguments as TRY except [DEBUG][argument], [COUNT][argument] and RERUN. This is because REPLAY-EVENTS does not run any tests. It simply signals the events collected in TRIAL again to allow further processing. The values of *CATEGORIES* and *COUNT* that were in effect for TRIAL are used, and their current values are ignored to be able to keep consistent counts (see @TRY/COUNT).

Suppose we have run a large test using the default ‘:PRINT ’LEAF‘ ‘:COLLECT ’UNEXPECTED‘ arguments for TRY, and now we have too much output to look at. Instead of searching for the interesting bits in the output, we can replay the events and print only the UNEXPECTED events:

“‘
(replay-events ! :print ’unexpected)
“‘

Or we could tell the printer to just print markers for *CATEGORIES* and :DESCRIBE at the end:

“‘
(let ((*print-parent* nil)
(*print-compactly* t)
(*defer-describe* t)
(*categories* (ascii-std-categories)))
(replay-events !))
.. ................F................!.....
..
.. ;; UNEXPECTED-FAILURE (F) in SOME-TEST INNER-TEST:
.. (IS (= 5 6))
.. debug info
..
.. ;; UNHANDLED-ERROR (!) in SOME-TEST:
.. "my-msg" (MY-ERR)
“‘

Package

try.

Source

replay.lisp.

Function: retry-check (&optional condition)

Initiate a @NON-LOCAL-EXIT to go reevaluate the forms wrapped by the check without signalling an OUTCOME.

Package

try.

Source

outcome.lisp.

Function: retry-trial (&optional condition trial)

Invoke the RETRY-TRIAL restart of RUNNINGP TRIAL. The RETRY-TRIAL restart may record CONDITION, then it initiates a @NON-LOCAL-EXIT to go back to the beginning of the test function. If the non-local exit completes, then

- (N-RETRIES TRIAL) is incremented,
- collected results and trials are cleared (see @TRY/COLLECT),
- counts are zeroed (see @TRY/COUNT), and
- TRIAL-START is signalled again.

If during the unwinding ABORT-TRIAL or SKIP-TRIAL is called, then the retry is cancelled.

CONDITION (which may be NIL) is recorded if it is an EVENT but not the VERDICT of TRIAL, and the RECORD-EVENT restart is available.

Package

try.

Source

trial.lisp.

Function: runningp (trial)

See if the function call associated with TRIAL has not returned yet. Trials that are not running have a VERDICT and are said to be finished.

Package

try.

Source

trial.lisp.

Function: set-try-debug (debug)

Invoke the SET-TRY-DEBUG restart to override the DEBUG argument of the currently running TRY. DEBUG must thus be a suitable type. When the SET-TRY-DEBUG restart is invoked interactively, DEBUG is read as a non-evaluated form from *QUERY-IO*.

Package

try.

Source

try.lisp.

Function: skip-check (&optional condition)

Change the OUTCOME of the check being signalled to RESULT-SKIP. RESULT-SKIP, being a PASS, will cause the check to return T if CONTINUE or RECORD-EVENT is invoked on it.

Package

try.

Source

outcome.lisp.

Function: skip-trial (&optional condition trial)

Invoke the SKIP-TRIAL restart of a RUNNINGP TRIAL.

When CONDITION is a VERDICT for TRIAL, SKIP-TRIAL signals a new verdict of type VERDICT-SKIP. This behavior is similar to that of SKIP-CHECK. Else, the SKIP-TRIAL restart may record CONDITION, then it initiates a @NON-LOCAL-EXIT to return from the test function with VERDICT-SKIP. If during the unwinding ABORT-TRIAL or RETRY-TRIAL is called, then the skip is cancelled.

“‘cl-transcript (:dynenv try-transcript)
(with-test (skipped)
(handler-bind ((unexpected-result-failure #’skip-trial))
(is nil)))
.. SKIPPED
.. ⊠ (IS NIL)
.. - SKIPPED ⊠1
..
==> #<TRIAL (WITH-TEST (SKIPPED)) SKIP 0.000s ⊠1>
“‘

Invoking SKIP-TRIAL on the TRIAL’s own TRIAL-START skips the trial being started.

“‘cl-transcript (:dynenv try-transcript)
(let ((*print* ’(or outcome leaf)))
(with-test (parent)
(handler-bind ((trial-start #’skip-trial))
(with-test (child)
(is nil)))))
.. PARENT
.. - CHILD
.. ⋅ PARENT
..
“‘

Package

try.

Source

trial.lisp.

Reader: sub-new-form (instance)
Writer: (setf sub-new-form) (instance)
Package

try.

Source

is.lisp.

Target Slot

new-form.

Reader: sub-subform (instance)
Writer: (setf sub-subform) (instance)
Package

try.

Source

is.lisp.

Target Slot

subform.

Reader: sub-valuesp (instance)
Writer: (setf sub-valuesp) (instance)
Package

try.

Source

is.lisp.

Target Slot

valuesp.

Reader: sub-var (instance)
Writer: (setf sub-var) (instance)
Package

try.

Source

is.lisp.

Target Slot

var.

Function: test-bound-p (symbol)

See if SYMBOL names a global test (i.e. a test defined with DEFTEST). If since the execution of DEFTEST, the symbol has been uninterned, FMAKUNBOUND, or redefined with DEFUN, then it no longer names a global test.

Package

try.

Source

test.lisp.

Function: try (testable &key debug count collect rerun print describe stream printer)

TRY runs TESTABLE and handles the EVENTs to collect, debug, print the results of checks and trials, and to decide what tests to skip and what to rerun.

DEBUG, COUNT, COLLECT, RERUN, PRINT, and DESCRIBE must all be valid specifiers for types that are either NIL (the empty type) or have a non-empty intersection with the type EVENT (e.g. T, OUTCOME, UNEXPECTED, VERDICT).

TRY sets up a HANDLER-BIND handler for EVENTs and runs TESTABLE (see @TRY/TESTABLES). When an EVENT is signalled, the handler matches its type to the value of the DEBUG argument (in the sense of ‘(TYPEP EVENT DEBUG)‘). If it matches, then the debugger is invoked with the event. In the debugger, the user has a number of restarts available to change (see @TRY/EVENT-RESTARTS, @TRY/OUTCOME-RESTARTS, @TRY/CHECK-RESTARTS, @TRY/TRIAL-RESTARTS, and SET-TRY-DEBUG.

If the debugger is not invoked, TRY invokes the very first restart available, which is always RECORD-EVENT.

Recording the event is performed as follows.

- Outcome counts are updated (see @TRY/COUNT).
- The event is passed to the collector (see @TRY/COLLECT).
- The event is passed to the printer (see @TRY/PRINT).
- Finally, when rerunning a trial (i.e. when TESTABLE is a trial), on a TRIAL-START event, the trial may be skipped (see @TRY/RERUN).

TRY returns the values returned by the outermost trial (see @TRY/TESTS).

Package

try.

Source

try.lisp.


5.1.4 Generic functions

Generic Reader: backtrace-of (condition)
Package

try.

Methods
Reader Method: backtrace-of ((condition unhandled-error))
Source

error.lisp.

Target Slot

backtrace.

Generic Reader: children (object)
Package

try.

Methods
Reader Method: children ((trial trial))

A list of immediate child VERDICTs, RESULTs, and
ERROR*s collected in reverse chronological order (see @TRY/COLLECT). The VERDICT of this TRIAL is not among CHILDREN, but the VERDICTs of child trials’ are.

Source

trial.lisp.

Target Slot

children.

Generic Reader: debugger-invoked-p (condition)
Package

try.

Methods
Reader Method: debugger-invoked-p ((condition unhandled-error))
Source

error.lisp.

Target Slot

debugger-invoked-p.

Generic Reader: n-retries (object)
Package

try.

Methods
Reader Method: n-retries ((trial trial))

The number of times this [TRIAL][dislocated] has been retried. See RETRY-TRIAL.

Source

trial.lisp.

Target Slot

n-retries.

Generic Reader: nested-condition (condition)
Package

try.

Methods
Reader Method: nested-condition ((condition unhandled-error))
Source

error.lisp.

Target Slot

nested-condition.

Generic Function: substitute-is-list-form (first form env)

In the list FORM, whose CAR is FIRST, substitute
subexpressions of interest with a GENSYM and return the new form. As the second value, return a list of SUBs.

For example, consider ‘(IS (FIND (FOO) LIST))‘. When SUBSTITUTE-IS-LIST-FORM is invoked on ‘(FIND (FOO) LIST)‘, it substitutes each argument of FIND with a variable, returning the new form ‘(FIND TEMP1 TEMP2)‘ and the list of two
substitutions ‘((TEMP2 (FOO) (FOO) NIL) (TEMP3 LIST LIST NIL))‘. This allows the original form to be rewritten as

“‘
(let* ((temp1 (foo))
(temp2 list))
(find temp1 temp2))
“‘

TEMP1 and TEMP2 may then be reported in the OUTCOME condition signalled by IS like this:

The following check failed:
(is (find #1=(foo) #2=list))
where
#1# = <return-value-of-foo>
#2# = <value-of-variable-list>

Package

try.

Source

is.lisp.

Methods
Method: substitute-is-list-form ((first (eql try:match-values)) form env)
Source

checks.lisp.

Method: substitute-is-list-form ((first (eql not)) form env)
Method: substitute-is-list-form ((first (eql endp)) form env)
Method: substitute-is-list-form ((first (eql null)) form env)
Method: substitute-is-list-form (first form env)
Generic Reader: test-name (condition)
Package

try.

Methods
Reader Method: test-name ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

test-name.

Reader Method: test-name ((condition error*))
Source

error.lisp.

Target Slot

test-name.

Generic Reader: trial (condition)
Package

try.

Methods
Reader Method: trial ((condition trial-event))
Source

trial-event.lisp.

Target Slot

trial.

Generic Reader: trial-start (object)
Package

try.

Methods
Reader Method: trial-start ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

trial-start.

Generic Reader: verdict (object)
Package

try.

Methods
Reader Method: verdict ((trial trial))

The [VERDICT][condition] EVENT signalled when this [TRIAL][dislocated] finished or NIL if it has not finished yet.

Source

trial.lisp.

Target Slot

verdict.


5.1.5 Standalone methods

Method: close ((stream wrapped-stream) &key abort)
Source

gray-stream.lisp.

Method: initialize-instance :after ((trial trial) &key)
Source

trial.lisp.

Method: initialize-instance :after ((printer printer) &key &allow-other-keys)
Source

print.lisp.

Method: initialize-instance :after ((stream line/column-character-output-stream) &key &allow-other-keys)
Source

gray-stream.lisp.

Method: print-object ((event event) stream)
Source

events.lisp.

Method: print-object ((trial trial) stream)
Source

trial.lisp.

Method: print-object ((dummy dummy-with-print-object) stream)
Source

util.lisp.

Method: stream-element-type ((stream wrapped-stream))
Source

gray-stream.lisp.

Method: stream-line-column ((stream line/column-character-output-stream))
Package

sb-gray.

Source

gray-stream.lisp.

Method: stream-write-char ((stream line/column-character-output-stream) char)
Package

sb-gray.

Source

gray-stream.lisp.


5.1.6 Conditions

Condition: abort*

‘RESULT-ABORT*‘, ‘VERDICT-ABORT*‘ or ERROR*.

Package

try.

Source

events.lisp.

Direct superclasses

unexpected.

Direct subclasses
Condition: dismissal

The third possibility after SUCCESS and FAILURE. Either SKIP or ABORT*.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Condition: error*

Either UNHANDLED-ERROR or NLX, ERROR* causes or
represents abnormal termination of a TRIAL. ABORT-TRIAL can be called with ERROR*s, but there is little need for explicitly doing so as RECORD-EVENT, which TRY invokes, takes care of this.

Package

try.

Source

error.lisp.

Direct superclasses
Direct subclasses
Direct methods

test-name.

Direct slots
Slot: test-name
Initargs

:test-name

Readers

test-name.

Writers

This slot is read-only.

Condition: event

Common abstract superclass of all events in Try.

Package

try.

Source

events.lisp.

Direct superclasses

condition.

Direct subclasses
Direct methods

print-object.

Condition: expected

Concrete condition classes with EXPECTED in their
name are subclasses of EXPECTED. SKIP is also a subclass of EXPECTED.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Condition: expected-result-failure
Package

try.

Source

result.lisp.

Direct superclasses
Condition: expected-result-success
Package

try.

Source

result.lisp.

Direct superclasses
Condition: expected-verdict-failure
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: expected-verdict-success
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: failure

See SUCCESS.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Condition: leaf

RESULT or ERROR*.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Direct methods

print-event.

Condition: nlx

Representing a @NON-LOCAL-EXIT of unknown origin,
this is signalled if a TRIAL does not return normally although it should have because it was not dismissed (see DISMISSAL, SKIP-TRIAL, ABORT-TRIAL). In this case, there is no CL:ERROR associated with the event.

Package

try.

Source

error.lisp.

Direct superclasses

error*.

Direct methods
Direct slots
Slot: extra-message
Initargs

:extra-message

Readers

extra-message.

Writers

This slot is read-only.

Condition: outcome

An OUTCOME is the resolution of either a TRIAL or a
check (see @TRY/CHECKS), corresponding to subclasses VERDICT and RESULT.

Package

try.

Source

outcome.lisp.

Direct superclasses

event.

Direct subclasses
Condition: result
Package

try.

Source

result.lisp.

Direct superclasses
Direct subclasses
Direct methods
Direct slots
Slot: check
Initargs

:check

Readers

check.

Writers

This slot is read-only.

Slot: elapsed-seconds
Initform

(quote nil)

Initargs

:elapsed-seconds

Readers

elapsed-seconds.

Writers

This slot is read-only.

Slot: msg
Initform

(quote nil)

Initargs

:msg

Readers

msg.

Writers

This slot is read-only.

Slot: ctx
Initform

(quote nil)

Initargs

:ctx

Readers

ctx.

Writers

This slot is read-only.

Slot: captures
Initform

(quote nil)

Initargs

:captures

Readers

captures.

Writers

This slot is read-only.

Slot: print-captures
Initform

(quote t)

Initargs

:print-captures

Readers

print-captures.

Writers

This slot is read-only.

Slot: print-form-memoization-data
Initform

(quote nil)

Readers

print-form-memoization-data.

Writers

(setf print-form-memoization-data).

Condition: result-abort*
Package

try.

Source

result.lisp.

Direct superclasses
Condition: result-skip
Package

try.

Source

result.lisp.

Direct superclasses
Condition: skip

RESULT-SKIP or VERDICT-SKIP.

Package

try.

Source

outcome.lisp.

Direct superclasses
Direct subclasses
Condition: success

See @TRY/CHECKS and @TRY/TRIAL-VERDICTS for how SUCCESS or FAILURE is decided.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Condition: trial-event

A TRIAL-EVENT is either a TRIAL-START or a VERDICT.

Package

try.

Source

trial-event.lisp.

Direct superclasses

event.

Direct subclasses
Direct methods

trial.

Direct slots
Slot: trial

The TRIAL object associated with this event.

Initargs

:trial

Readers

trial.

Writers

This slot is read-only.

Condition: trial-start

TRIAL-START is signalled when a test function
(see @TRY/TESTS) is entered and a TRIAL is started, it is already
the CURRENT-TRIAL, and the @TRY/TRIAL-RESTARTS are available. It is also signalled when a trial is retried:

“‘cl-transcript
(let ((*print* nil)
(n 0))
(with-test ()
(handler-bind ((trial-start (lambda (c)
(format t "TRIAL-START for ~S retry#~S~%" (test-name (trial c)) (n-retries (trial c)))))) (with-test (this)
(incf n)
(when (< n 3)
(retry-trial))))))
.. TRIAL-START for THIS retry#0
.. TRIAL-START for THIS retry#1
.. TRIAL-START for THIS retry#2
..
“‘

The matching of TRIAL-START events is less straightforward than that
of other EVENTs.

- When a TRIAL-START event matches the ‘COLLECT‘ type (see @TRY/COLLECT), its [TRIAL][(reader trial-event)] is collected.

- Similarly, when a TRIAL-START matches the [PRINT][argument]
type (see @TRY/PRINT), it is printed immediately, and its trial’s VERDICT will be printed too regardless of whether it matches [PRINT][argument]. If TRIAL-START does not match
[PRINT][argument], it may still be printed if for example *PRINT-PARENT* requires it.

- When a TRIAL-START matches the ‘RERUN‘ type (see @TRY/RERUN), its [TRIAL][(reader trial-event)] may be rerun.

- Also, see WITH-SKIP.

Package

try.

Source

trial-event.lisp.

Direct superclasses

trial-event.

Direct methods
Condition: unexpected

Concrete condition classes with UNEXPECTED in their
name are subclasses of UNEXPECTED. ABORT* is also a subclass of UNEXPECTED.

Package

try.

Source

events.lisp.

Direct superclasses

event.

Direct subclasses
Condition: unexpected-result-failure
Package

try.

Source

result.lisp.

Direct superclasses
Condition: unexpected-result-success
Package

try.

Source

result.lisp.

Direct superclasses
Condition: unexpected-verdict-failure
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: unexpected-verdict-success
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: unhandled-error

Signalled when an CL:ERROR condition reaches the
handlers set up DEFTEST or WITH-TEST, or when their *DEBUGGER-HOOK* is invoked with a condition that’s not an EVENT.

Package

try.

Source

error.lisp.

Direct superclasses

error*.

Direct methods
Direct slots
Slot: nested-condition

The unhandled condition.

Initform

(quote nil)

Initargs

:condition

Readers

nested-condition.

Writers

This slot is read-only.

Slot: backtrace

A string if *GATHER-BACKTRACE* was true when this event was signalled, NIL otherwise.

Initform

(quote nil)

Initargs

:backtrace

Readers

backtrace-of.

Writers

This slot is read-only.

Slot: debugger-invoked-p

True if NESTED-CONDITION was caught by a trial’s *DEBUGGER-HOOK*, NIL if it was caught by its ERROR handler.

Initform

(quote nil)

Initargs

:debugger-invoked-p

Readers

debugger-invoked-p.

Writers

This slot is read-only.

Condition: verdict

A VERDICT is the OUTCOME of a TRIAL. It is one of ‘{EXPECTED,UNEXPECTED}-VERDICT-{SUCCESS,FAILURE}‘, VERDICT-SKIP and VERDICT-ABORT*. Regarding how the verdict type is determined, see @TRY/TRIAL-VERDICTS.

Verdicts are signalled while their [TRIAL][(reader trial-event)] is
still the CURRENT-TRIAL, and @TRY/TRIAL-RESTARTS are still
available.

“‘cl-transcript (:check-consistency nil)
(try (lambda ()
(handler-bind (((and verdict failure) #’retry-trial))
(with-test (this)
(is (zerop (random 2)))))))
.. (TRY #<FUNCTION (LAMBDA ()) {53038ADB}>)
.. THIS
.. ⊠ (IS (ZEROP #1=(RANDOM 2)))
.. where
.. #1# = 1
.. THIS retry #1
.. ⋅ (IS (ZEROP (RANDOM 2)))
.. ⋅ THIS ⋅1
.. ⋅ (TRY #<FUNCTION (LAMBDA ()) {53038ADB}>) ⋅1
..
==> #<TRIAL (TRY #<FUNCTION (LAMBDA ()) {53038ADB}>) EXPECTED-SUCCESS 0.000s ⋅1> “‘

Package

try.

Source

trial-event.lisp.

Direct superclasses
Direct subclasses
Direct methods
Direct slots
Slot: elapsed-seconds
Initform

(quote nil)

Initargs

:elapsed-seconds

Readers

elapsed-seconds.

Writers

This slot is read-only.

Condition: verdict-abort*
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: verdict-skip
Package

try.

Source

trial-event.lisp.

Direct superclasses

Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.7 Structures

Structure: sub

A SUB (short for substitution) says that in the original form IS is checking, a SUBFORM was substituted (by SUBSTITUTE-IS-FORM) with VAR (if VALUESP is NIL) or with (VALUES-LIST VAR) if VALUESP is true. Conversely, VAR is to be bound to the evaluated NEW-FORM if VALUESP is NIL, and to (MULTIPLE-VALUE-LIST FORM) if VALUESP. NEW-FORM is often ‘EQ‘ to SUBFORM, but it may be different, which is the case when further substitutions are made within a substitution.

Package

try.

Source

is.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: var
Readers

sub-var.

Writers

(setf sub-var).

Slot: subform
Readers

sub-subform.

Writers

(setf sub-subform).

Slot: new-form
Readers

sub-new-form.

Writers

(setf sub-new-form).

Slot: valuesp
Readers

sub-valuesp.

Writers

(setf sub-valuesp).


Next: , Previous: , Up: Public Interface   [Contents][Index]

5.1.8 Classes

Class: tree-printer

TREE-PRINTER prints events in an indented
tree-like structure, with each internal node corresponding to a TRIAL. This is the default printer (according to *PRINTER* and *TRY-PRINTER*) and currently the only one.

The following example prints all @TRY/CONCRETE-EVENTS.

“‘cl-transcript (:dynenv try-transcript)
(let ((*debug* nil)
(*print* ’(not trial-start))
(*describe* nil))
(with-test (verdict-abort*)
(with-test (expected-verdict-success))
(with-expected-outcome (’failure)
(with-test (unexpected-verdict-success)))
(handler-bind (((and verdict success) #’force-expected-failure)) (with-test (expected-verdict-failure)))
(handler-bind (((and verdict success) #’force-unexpected-failure)) (with-test (unexpected-verdict-failure)))
(with-test (verdict-skip)
(skip-trial))
(is t :msg "EXPECTED-RESULT-SUCCESS")
(with-failure-expected (’failure)
(is t :msg "UNEXPECTED-RESULT-SUCCESS")
(is nil :msg "EXPECTED-RESULT-FAILURE"))
(is nil :msg "UNEXPECTED-RESULT-FAILURE")
(with-skip ()
(is nil :msg "RESULT-SKIP"))
(handler-bind (((and result success) #’abort-check))
(is t :msg "RESULT-ABORT*"))
(catch ’foo
(with-test (nlx-test)
(throw ’foo nil)))
(error "UNHANDLED-ERROR")))
.. VERDICT-ABORT* ; TRIAL-START
.. ⋅ EXPECTED-VERDICT-SUCCESS
.. ⊡ UNEXPECTED-VERDICT-SUCCESS
.. × EXPECTED-VERDICT-FAILURE
.. ⊠ UNEXPECTED-VERDICT-FAILURE
.. - VERDICT-SKIP
.. ⋅ EXPECTED-RESULT-SUCCESS
.. ⊡ UNEXPECTED-RESULT-SUCCESS
.. × EXPECTED-RESULT-FAILURE
.. ⊠ UNEXPECTED-RESULT-FAILURE
.. - RESULT-SKIP
.. ⊟ RESULT-ABORT*
.. NLX-TEST ; TRIAL-START
.. ⊟ non-local exit ; NLX
.. ⊟ NLX-TEST ⊟1 ; VERDICT-ABORT*
.. ⊟ "UNHANDLED-ERROR" (SIMPLE-ERROR)
.. ⊟ VERDICT-ABORT* ⊟3 ⊠1 ⊡1 -1 ×1 ⋅1
..
==> #<TRIAL (WITH-TEST (VERDICT-ABORT*)) ABORT* 0.004s ⊟3 ⊠1 ⊡1 -1 ×1 ⋅1> “‘

The ‘⊟3 ⊠1 ⊡1 -1 ×1 ⋅1‘ part is the counts for *CATEGORIES* printed with their markers.

Package

try.

Source

print.lisp.

Direct superclasses

printer.

Direct methods
Direct slots
Slot: indentation
Initform

try:*print-indentation*

Readers

indentation.

Writers

This slot is read-only.

Slot: print-duration-p
Initform

try:*print-duration*

Readers

print-duration-p.

Writers

This slot is read-only.

Slot: print-compactly
Initform

try:*print-compactly*

Readers

print-compactly.

Writers

This slot is read-only.

Slot: defer-describe
Initform

try:*defer-describe*

Readers

defer-describe.

Writers

This slot is read-only.

Slot: to-be-described
Readers

to-be-described.

Writers

(setf to-be-described).

Class: trial

Trials are records of calls to tests (see
@TRY/COUNT, @TRY/COLLECT). Their behaviour as @FUNCALLABLE-INSTANCEs is explained in @TRY/RERUN.

There are three ways to acquire a TRIAL object: by calling CURRENT-TRIAL, through the lexical binding of the symbol that names the test or through the return value of a test:

“‘cl-transcript (:dynenv try-transcript)
(deftest xxx ()
(prin1 xxx))

(xxx)
.. #<TRIAL (XXX) RUNNING>
==> #<TRIAL (XXX) EXPECTED-SUCCESS 0.000s>
“‘

WITH-TRIAL can also provide access to its TRIAL:

“‘cl-transcript (:dynenv try-transcript)
(with-test (t0)
(prin1 t0))
.. #<TRIAL (WITH-TEST (T0)) RUNNING>
==> #<TRIAL (WITH-TEST (T0)) EXPECTED-SUCCESS 0.000s>
“‘

TRIALs are not to be instantiated by client code.

Package

try.

Source

trial.lisp.

Direct superclasses

funcallable-standard-object.

Direct methods
Direct slots
Slot: test-name
Initform

(error "trials are not to be instantiated directly.")

Initargs

try::%test-name

Readers

test-name.

Writers

This slot is read-only.

Slot: cform
Initargs

:cform

Readers

cform.

Writers

This slot is read-only.

Slot: parent
Initform

try::*trial*

Readers

parent.

Writers

This slot is read-only.

Slot: depth
Initform

(if try::*trial* (1+ (slot-value try::*trial* (quote try::depth))) 0)

Readers

depth.

Writers

This slot is read-only.

Slot: abort-restart
Readers

abort-restart.

Writers

(setf abort-restart).

Slot: skip-restart
Readers

skip-restart.

Writers

(setf skip-restart).

Slot: retry-restart
Readers

retry-restart.

Writers

(setf retry-restart).

Slot: trial-start
Readers

trial-start.

Writers

This slot is read-only.

Slot: elapsed-seconds
Initargs

:elapsed-seconds

Readers

elapsed-seconds.

Writers

This slot is read-only.

Slot: categories
Initform

(if try::*trial* (try::categories try::*trial*) try:*categories*)

Initargs

:categories

Readers

categories.

Writers

This slot is read-only.

Slot: count
Package

common-lisp.

Initform

(if try::*trial* (try::count-of try::*trial*) try:*count*)

Initargs

:count

Readers

count-of.

Writers

This slot is read-only.

Slot: n-retries

The number of times this [TRIAL][dislocated] has been retried. See RETRY-TRIAL.

Initform

0

Initargs

:n-retries

Readers

n-retries.

Writers

This slot is read-only.

Slot: how-to-end
Type

(member nil :return :abort :retry :skip)

Initform

:return

Initargs

:how-to-end

Readers

how-to-end.

Writers

(setf how-to-end).

Slot: how-it-ended
Readers

how-it-ended.

Writers

This slot is read-only.

Slot: verdict

The [VERDICT][condition] EVENT signalled when this [TRIAL][dislocated] finished or NIL if it has not finished yet.

Readers

verdict.

Writers

This slot is read-only.

Slot: children

A list of immediate child VERDICTs, RESULTs, and
ERROR*s collected in reverse chronological order (see @TRY/COLLECT). The VERDICT of this TRIAL is not among CHILDREN, but the VERDICTs of child trials’ are.

Initargs

:children

Readers

children.

Writers

This slot is read-only.

Slot: has-non-collected-failed-child-p
Initargs

:has-non-collected-failed-child-p

Readers

has-non-collected-failed-child-p.

Writers

This slot is read-only.

Slot: counter
Initargs

:counter

Readers

counter.

Writers

This slot is read-only.

Slot: non-collected-counter
Initargs

:non-collected-counter

Readers

non-collected-counter.

Writers

This slot is read-only.


Previous: , Up: Public Interface   [Contents][Index]

5.1.9 Types

Type: expected-failure ()

A shorthand for ‘(AND EXPECTED FAILURE)‘.

Package

try.

Source

events.lisp.

Type: expected-success ()

A shorthand for ‘(AND EXPECTED SUCCESS)‘.

Package

try.

Source

events.lisp.

Type: fail ()

An ABORT* or an UNEXPECTED FAILURE.

Package

try.

Source

events.lisp.

Type: pass ()

An OUTCOME that’s not an ABORT* or an UNEXPECTED FAILURE.

Package

try.

Source

events.lisp.

Type: unexpected-failure ()

A shorthand for ‘(AND UNEXPECTED FAILURE)‘.

Package

try.

Source

events.lisp.

Type: unexpected-success ()

A shorthand for ‘(AND UNEXPECTED SUCCESS)‘.

Package

try.

Source

events.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: *call-test*
Package

try.

Source

test.lisp.

Special Variable: *call-test-fn*
Package

try.

Source

test.lisp.

Special Variable: *dbg*
Package

try.

Source

debug.lisp.

Special Variable: *dummy*
Package

try.

Source

util.lisp.

Special Variable: *expected-outcome*
Package

try.

Source

outcome.lisp.

Special Variable: *internal-error*
Package

try.

Source

debug.lisp.

Special Variable: *invoking-debugger*
Package

try.

Source

try.lisp.

Special Variable: *print-backtrace*
Package

try.

Source

error.lisp.

Special Variable: *recent-trials*
Package

try.

Source

try.lisp.

Special Variable: *record-event*
Package

try.

Source

early.lisp.

Special Variable: *skip*
Package

try.

Source

outcome.lisp.

Special Variable: *start-time*
Package

try.

Source

util.lisp.

Special Variable: *testing-timing*
Package

try.

Source

util.lisp.

Special Variable: *tests-run*
Package

try.

Source

test.lisp.

Special Variable: *trial*
Package

try.

Source

early.lisp.

Special Variable: *trial-initargs*
Package

try.

Source

test.lisp.

Special Variable: *try-id*
Package

try.

Source

early.lisp.

Special Variable: @cancelled-nlx
Package

try.

Source

manual.lisp.

Special Variable: @funcallable-instance
Package

try.

Source

manual.lisp.

Special Variable: @function-designator
Package

try.

Source

manual.lisp.

Special Variable: @non-local-exit
Package

try.

Source

manual.lisp.


5.2.2 Macros

Macro: %unwind-protect (protected &body cleanup)
Package

try.

Source

util.lisp.

Macro: condition-match-checker ((condition-type &key pred handler on-return on-nlx name msg ctx check-function) &body body)
Package

try.

Source

checks.lisp.

Macro: dbg (format-control &rest format-args)
Package

try.

Source

debug.lisp.

Macro: define-combi-event (basic-superclasses)
Package

try.

Source

events.lisp.

Macro: define-macrolet (symbol lambda-list &body docstring)
Package

try.

Source

is.lisp.

Macro: match-values% (form &body body)
Package

try.

Source

checks.lisp.

Macro: on-finish (protected &body cleanup)
Package

try.

Source

util.lisp.

Macro: on-nlx (protected &body cleanup)
Package

try.

Source

util.lisp.

Macro: on-return (protected &body cleanup)
Package

try.

Source

util.lisp.

Macro: remembering-most-recent-trials (&body body)
Package

try.

Source

try.lisp.

Macro: restart-bind (((&key stream condition) &rest bindings) &body body)
Package

try.

Source

util.lisp.

Macro: restart-case (form (&key stream condition) &body bindings)
Package

try.

Source

util.lisp.

Macro: try-default-unspecified-args (&key replayp)
Package

try.

Source

try.lisp.

Macro: with-bindings (bindings &body body)
Package

try.

Source

util.lisp.

Macro: with-circularity-detection ((stream) &body body)
Package

try.

Source

util.lisp.

Macro: with-condition-matching ((matchedp &optional best-match) (condition-type &key pred handler) &body body)
Package

try.

Source

checks.lisp.

Macro: with-current-debug ((var init-form) &body body)
Package

try.

Source

try.lisp.

Macro: with-debugger-hook (fn &body body)
Package

try.

Source

util.lisp.

Macro: with-debugger-hook-form (form &body body)
Package

try.

Source

util.lisp.

Macro: with-error*-handled ((trial) &body body)
Package

try.

Source

trial.lisp.

Macro: with-gensyms (vars &body body)
Package

try.

Source

util.lisp.

Macro: with-internal-errors (&body body)
Package

try.

Source

debug.lisp.

Macro: with-retry ((&key retry on-retry) &body body)
Package

try.

Source

util.lisp.

Macro: with-retry/catch ((&key catch on-retry) &body body)
Package

try.

Source

util.lisp.

Macro: with-timing (&body body)
Package

try.

Source

util.lisp.

Macro: with-trial ((trial) &body body)
Package

try.

Source

trial.lisp.

Macro: with-trial-restarts ((trial &key return-form retry-form resignal-verdict-form) &body body)
Package

try.

Source

trial.lisp.

Macro: with-try-context (&body body)
Package

try.

Source

try.lisp.

Macro: without-tail-call (&body body)
Package

try.

Source

util.lisp.

Macro: wrap-trial-body-for-return (trial &body body)
Package

try.

Source

test.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: %%write-result-msg (result stream)
Package

try.

Source

result.lisp.

Reader: %collector-collect-type (instance)
Writer: (setf %collector-collect-type) (instance)
Package

try.

Source

collect.lisp.

Target Slot

collect-type.

Reader: %collector-count-type (instance)
Writer: (setf %collector-count-type) (instance)
Package

try.

Source

collect.lisp.

Target Slot

count-type.

Function: %collector-p (object)
Package

try.

Source

collect.lisp.

Function: %count-and-collect-event (collector event)
Package

try.

Source

collect.lisp.

Function: %describe-condition-for-matching (condition &optional stream)
Package

try.

Source

checks.lisp.

Function: %ensure-new-line (stream)
Package

try.

Source

print.lisp.

Function: %ensure-trial-printed (trial printer)
Package

try.

Source

print.lisp.

Function: %extract-options (option-names body &key options-first)
Package

try.

Source

util.lisp.

Function: %frob-form-for-printing (result form)
Package

try.

Source

result.lisp.

Function: %make-counter (&key counts categories)
Package

try.

Source

count.lisp.

Function: %make-indent (n)
Package

try.

Source

print.lisp.

Function: %make-rerun-trial-event-handler (trial-to-rerun rerun-type)
Package

try.

Source

rerun.lisp.

Function: %match-condition (condition condition-type pred)
Package

try.

Source

checks.lisp.

Function: %maybe-invoke-debugger (outcome debug-outcome-type)
Package

try.

Source

try.lisp.

Function: %print-event (printer event)
Package

try.

Source

print.lisp.

Function: %print-indent-for (printer event)
Package

try.

Source

print.lisp.

Function: %print-leaf (printer leaf)
Package

try.

Source

print.lisp.

Function: %print-verdict (printer verdict)
Package

try.

Source

print.lisp.

Function: %replay-events (trial)
Package

try.

Source

replay.lisp.

Function: %replay-trial-initargs (trial)
Package

try.

Source

replay.lisp.

Function: %subs-to-bindings (subs)
Package

try.

Source

is.lisp.

Function: %subs-to-captures (subs)
Package

try.

Source

is.lisp.

Function: %trial-basic-verdict (trial)
Package

try.

Source

trial.lisp.

Function: %wrap-restart-bind-binding-in-lambda (binding stream-var condition-var)
Package

try.

Source

util.lisp.

Function: %wrap-restart-bind-option-in-lambda (option form stream-var condition-var)
Package

try.

Source

util.lisp.

Function: %wrap-restart-case-binding-in-lambda (binding stream-var condition-var)
Package

try.

Source

util.lisp.

Function: %wrap-restart-case-option-in-lambda (option form stream-var condition-var)
Package

try.

Source

util.lisp.

Function: %write-result (result stream &key terse ctx)
Package

try.

Source

result.lisp.

Function: %write-result-captures (result stream)
Package

try.

Source

result.lisp.

Function: %write-result-ctx (result stream)
Package

try.

Source

result.lisp.

Function: %write-result-msg (result stream &key terse)
Package

try.

Source

result.lisp.

Function: add-to-counter (counter1 counter2)
Package

try.

Source

count.lisp.

Function: add-to-recent-trials (trial)
Package

try.

Source

try.lisp.

Function: ancestor-trial-names (trial)
Package

try.

Source

print.lisp.

Function: ancestors-from-oldest (trial)
Package

try.

Source

print.lisp.

Function: bool= (a b)
Package

try.

Source

util.lisp.

Function: bump-counter (counter event)
Package

try.

Source

count.lisp.

Function: call-lambda-trial (trial)
Package

try.

Source

rerun.lisp.

Function: call-named-trial (cform)
Package

try.

Source

rerun.lisp.

Function: call-test ()
Package

try.

Source

test.lisp.

Function: call-testable (testable)
Package

try.

Source

testable.lisp.

Function: call-trial (trial)
Package

try.

Source

rerun.lisp.

Function: call-try-trial (trial)
Package

try.

Source

rerun.lisp.

Function: call-with-wrapper (function-designators wrapper-cform)
Package

try.

Source

testable.lisp.

Function: capture-explicitp (structure)
Package

try.

Source

is.lisp.

Function: (setf capture-explicitp) (structure)
Package

try.

Source

is.lisp.

Function: capture-subform (structure)
Package

try.

Source

is.lisp.

Function: (setf capture-subform) (structure)
Package

try.

Source

is.lisp.

Function: capture-value (structure)
Package

try.

Source

is.lisp.

Function: (setf capture-value) (structure)
Package

try.

Source

is.lisp.

Function: capture-valuesp (structure)
Package

try.

Source

is.lisp.

Function: (setf capture-valuesp) (structure)
Package

try.

Source

is.lisp.

Function: category-marker (event categories)
Package

try.

Source

events.lisp.

Function: check-event-type (type arg-name)
Package

try.

Source

try.lisp.

Function: check-fails (finishedp name msg ctx body)
Package

try.

Source

checks.lisp.

Function: check-invokes-debugger (condition-type pred name msg ctx body)
Package

try.

Source

checks.lisp.

Function: check-invokes-debugger-not (condition-type pred name msg ctx body)
Package

try.

Source

checks.lisp.

Function: check-printer-arg (printer)
Package

try.

Source

try.lisp.

Function: check-signals (condition-type pred name msg ctx body)
Package

try.

Source

checks.lisp.

Function: check-signals-not (condition-type pred name msg ctx body)
Package

try.

Source

checks.lisp.

Function: check-trial-running (trial)
Package

try.

Source

trial.lisp.

Function: child-trials (trial)
Package

try.

Source

rerun.lisp.

Function: clean-up-cancelled-nlx-of-retry-for-end-trial (trial)
Package

try.

Source

trial.lisp.

Function: clear-trial-restarts (trial)
Package

try.

Source

trial.lisp.

Function: combine-superclasses (basic-superclasses)
Package

try.

Source

events.lisp.

Function: compiler-policy (env)
Package

try.

Source

util.lisp.

Function: compiler-policy-quantity (quantity env)
Package

try.

Source

util.lisp.

Function: constantishp (form)
Package

try.

Source

is.lisp.

Function: copy-%collector (instance)
Package

try.

Source

collect.lisp.

Function: copy-capture (sequence)

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

try.

Alias for

copy-seq.

Function: copy-counter (counter)
Package

try.

Source

count.lisp.

Function: copy-print-state (instance)
Package

try.

Source

print.lisp.

Function: copy-sub (instance)
Package

try.

Source

is.lisp.

Function: count-and-collect-leaf (collector leaf)
Package

try.

Source

collect.lisp.

Function: count-and-collect-verdict (collector verdict)
Package

try.

Source

collect.lisp.

Function: count-collected-leaf (leaf count-type)
Package

try.

Source

collect.lisp.

Function: count-collected-verdict (verdict count-type)
Package

try.

Source

collect.lisp.

Function: count-non-collected-leaf (leaf count-type)
Package

try.

Source

collect.lisp.

Function: count-non-collected-verdict (verdict trial parent count-type)
Package

try.

Source

collect.lisp.

Function: count-trial-start (trial-start count-type)
Package

try.

Source

collect.lisp.

Reader: counter-categories (instance)
Writer: (setf counter-categories) (instance)
Package

try.

Source

count.lisp.

Target Slot

categories.

Reader: counter-counts (instance)
Writer: (setf counter-counts) (instance)
Package

try.

Source

count.lisp.

Target Slot

counts.

Function: counter-p (object)
Package

try.

Source

count.lisp.

Function: deftest-registry-var-name (package)
Package

try.

Source

test.lisp.

Function: describe-condition (condition &optional stream)
Package

try.

Source

error.lisp.

Function: describe-to-be-described (printer)
Package

try.

Source

print.lisp.

Function: determine-outcome-type (checkp basic-outcome &optional expected-type)
Package

try.

Source

outcome.lisp.

Function: double-float-~= (x y max-diff-in-value max-diff-in-ulp)
Package

try.

Source

floats.lisp.

Function: end-trial (trial)
Package

try.

Source

trial.lisp.

Function: ensure-deftest-registry (package)
Package

try.

Source

test.lisp.

Function: ensure-list (object)
Package

try.

Source

util.lisp.

Function: ensure-rest-arg (lambda-list &optional rest-var)
Package

try.

Source

util.lisp.

Function: event-category (event categories)
Package

try.

Source

events.lisp.

Function: event-print-depth (event printer)
Package

try.

Source

print.lisp.

Function: expand-with-trial-in-deftest-p (env)
Package

try.

Source

test.lisp.

Function: get-deftest-registry (package)
Package

try.

Source

test.lisp.

Function: get-elapsed-seconds ()
Package

try.

Source

util.lisp.

Function: intern-hyphenated (symbols)
Package

try.

Source

util.lisp.

Function: invoke-test-interactively (name lambda-list)
Package

try.

Source

test.lisp.

Function: invokes-debugger-default-ctx (condition-type)
Package

try.

Source

checks.lisp.

Function: invokes-debugger-default-msg (name body condition-type pred)
Package

try.

Source

checks.lisp.

Function: invokes-debugger-not-default-msg (name body condition-type pred)
Package

try.

Source

checks.lisp.

Function: lambda-list-to-arglist-form (lambda-list)
Package

try.

Source

util.lisp.

Function: lambda-list-with-&rest-to-arglist-form (lambda-list)
Package

try.

Source

util.lisp.

Function: lambda-trial-p (trial)
Package

try.

Source

trial.lisp.

Function: list-function-designators (testable)
Package

try.

Source

testable.lisp.

Function: make-%collector (&key count-type collect-type)
Package

try.

Source

collect.lisp.

Function: make-capture (subform value valuesp explicitp)
Package

try.

Source

is.lisp.

Function: make-counter (categories)
Package

try.

Source

count.lisp.

Function: make-gensym (object)
Package

try.

Source

util.lisp.

Function: make-print-state (&key trial n-retries first-line-and-column)
Package

try.

Source

print.lisp.

Function: make-trial (name cform &optional extra-initargs)
Package

try.

Source

test.lisp.

Function: maybe-backtrace (condition)
Package

try.

Source

error.lisp.

Function: maybe-mark-test-run (trial)
Package

try.

Source

test.lisp.

Function: named-trial-p (trial)
Package

try.

Source

trial.lisp.

Function: present-body (body)
Package

try.

Source

util.lisp.

Function: print-duration (seconds stream)
Package

try.

Source

print.lisp.

Function: print-event-header (printer event)
Package

try.

Source

print.lisp.

Reader: print-state-first-line-and-column (instance)
Writer: (setf print-state-first-line-and-column) (instance)
Package

try.

Source

print.lisp.

Target Slot

first-line-and-column.

Reader: print-state-n-retries (instance)
Writer: (setf print-state-n-retries) (instance)
Package

try.

Source

print.lisp.

Target Slot

n-retries.

Function: print-state-p (object)
Package

try.

Source

print.lisp.

Reader: print-state-trial (instance)
Writer: (setf print-state-trial) (instance)
Package

try.

Source

print.lisp.

Target Slot

trial.

Function: print-state-trial-printed-p (print-state)
Package

try.

Source

print.lisp.

Function: printer-depth (printer)
Package

try.

Source

print.lisp.

Function: read-argument-list (name lambda-list)
Package

try.

Source

test.lisp.

Function: read-try-debug ()
Package

try.

Source

try.lisp.

Function: register-deftest (symbol)
Package

try.

Source

test.lisp.

Function: report-change-outcome-to (stream outcome-type)
Package

try.

Source

outcome.lisp.

Function: reset-counter (counter)
Package

try.

Source

count.lisp.

Function: safe-subtypep (type1 type2)
Package

try.

Source

util.lisp.

Function: safe-typep (object type)
Package

try.

Source

util.lisp.

Function: same-but-different-implicit-captures-p (capture1 capture2)
Package

try.

Source

is.lisp.

Function: say-how-to-end (ancestor-trial ancestor-how-to-end until-then-how-to-end)
Package

try.

Source

trial.lisp.

Function: scrub-captures (captures)
Package

try.

Source

is.lisp.

Function: set-up-trial-restarts (trial)
Package

try.

Source

trial.lisp.

Function: shuffle (seq)

Copy of SEQ and shuffle it using Fisher-Yates algorithm.

Package

try.

Source

util.lisp.

Function: shuffle! (seq)

Shuffle SEQ using Fisher-Yates algorithm.

Package

try.

Source

util.lisp.

Function: shuffle-vector! (vector)
Package

try.

Source

util.lisp.

Function: signal-error* (unhandled-error trial &key extra-message debugger-invoked-p)
Package

try.

Source

error.lisp.

Function: signal-outcome (checkp basic-outcome initargs)
Package

try.

Source

outcome.lisp.

Function: signal-with-record-event (condition)
Package

try.

Source

events.lisp.

Function: single-float-~= (x y max-diff-in-value max-diff-in-ulp)
Package

try.

Source

floats.lisp.

Function: start-retry-for-trial (trial)
Package

try.

Source

trial.lisp.

Function: start-trial (trial)
Package

try.

Source

trial.lisp.

Function: stream-line-column* (stream)
Package

try.

Source

gray-stream.lisp.

Function: strip-outer-%-and-%%-from-implicit-captures (captures)
Package

try.

Source

is.lisp.

Function: sub-p (object)
Package

try.

Source

is.lisp.

Function: subseq* (seq start end)
Package

try.

Source

util.lisp.

Function: substitute-args (form)
Package

try.

Source

is.lisp.

Function: substitute-in-subs (subs env)
Package

try.

Source

is.lisp.

Function: substitute-is-form (form env)
Package

try.

Source

is.lisp.

Function: substitute-tilde-percent (string)
Package

try.

Source

result.lisp.

Function: sync-stream-line-column (to-column stream)
Package

try.

Source

gray-stream.lisp.

Function: trial-call-= (trial1 trial2)
Package

try.

Source

rerun.lisp.

Function: trial-has-event-of-type-p (trial type)
Package

try.

Source

rerun.lisp.

Function: trial-printed-p (trial printer)
Package

try.

Source

print.lisp.

Function: trialp (object)
Package

try.

Source

trial.lisp.

Function: try-trial-p (trial)
Package

try.

Source

trial.lisp.

Function: try-trial-testable (trial)
Package

try.

Source

trial.lisp.

Function: try/implicit (trial)
Package

try.

Source

try.lisp.

Function: valid-type-specifier-p (type)
Package

try.

Source

util.lisp.

Function: verdict-for-trial-p (trial event)
Package

try.

Source

trial.lisp.

Function: write-trial-counts (trial stream)
Package

try.

Source

print.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.4 Generic functions

Generic Reader: abort-restart (object)
Package

try.

Methods
Reader Method: abort-restart ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

abort-restart.

Generic Writer: (setf abort-restart) (object)
Package

try.

Methods
Writer Method: (setf abort-restart) ((trial trial))

automatically generated writer method

Source

trial.lisp.

Target Slot

abort-restart.

Generic Reader: captures (condition)
Package

try.

Methods
Reader Method: captures ((condition result))
Source

result.lisp.

Target Slot

captures.

Generic Reader: categories (object)
Package

try.

Methods
Reader Method: categories ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

categories.

Generic Reader: cform (object)
Package

try.

Methods
Reader Method: cform ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

cform.

Generic Reader: check (condition)
Package

try.

Methods
Reader Method: check ((condition result))
Source

result.lisp.

Target Slot

check.

Generic Reader: column (object)
Package

try.

Methods
Reader Method: column ((line/column-character-output-stream line/column-character-output-stream))

automatically generated reader method

Source

gray-stream.lisp.

Target Slot

column.

Generic Writer: (setf column) (object)
Package

try.

Methods
Writer Method: (setf column) ((line/column-character-output-stream line/column-character-output-stream))

automatically generated writer method

Source

gray-stream.lisp.

Target Slot

column.

Generic Reader: count-of (object)
Package

try.

Methods
Reader Method: count-of ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

count.

Generic Reader: counter (object)
Package

try.

Methods
Reader Method: counter ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

counter.

Generic Reader: ctx (condition)
Package

try.

Methods
Reader Method: ctx ((condition result))
Source

result.lisp.

Target Slot

ctx.

Generic Reader: defer-describe (object)
Package

try.

Methods
Reader Method: defer-describe ((tree-printer tree-printer))

automatically generated reader method

Source

print.lisp.

Target Slot

defer-describe.

Generic Reader: depth (object)
Package

try.

Methods
Reader Method: depth ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

depth.

Generic Function: describe-leaf (printer leaf)
Package

try.

Source

print.lisp.

Methods
Method: describe-leaf ((printer tree-printer) outcome)
Generic Reader: describe-type (object)
Package

try.

Methods
Reader Method: describe-type ((printer printer))

The DESCRIBE argument of TRY.

Source

print.lisp.

Target Slot

describe-type.

Generic Reader: elapsed-seconds (condition)
Package

try.

Methods
Reader Method: elapsed-seconds ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

elapsed-seconds.

Reader Method: elapsed-seconds ((condition verdict))
Source

trial-event.lisp.

Target Slot

elapsed-seconds.

Reader Method: elapsed-seconds ((condition result))
Source

result.lisp.

Target Slot

elapsed-seconds.

Generic Reader: extra-message (condition)
Package

try.

Methods
Reader Method: extra-message ((condition nlx))
Source

error.lisp.

Target Slot

extra-message.

Generic Function: finish-printing (printer)
Package

try.

Source

print.lisp.

Methods
Method: finish-printing ((printer tree-printer))
Method: finish-printing :around (printer)
Generic Reader: has-non-collected-failed-child-p (object)
Package

try.

Methods
Reader Method: has-non-collected-failed-child-p ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

has-non-collected-failed-child-p.

Generic Reader: how-it-ended (object)
Package

try.

Methods
Reader Method: how-it-ended ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

how-it-ended.

Generic Reader: how-to-end (object)
Package

try.

Methods
Reader Method: how-to-end ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

how-to-end.

Generic Writer: (setf how-to-end) (object)
Package

try.

Methods
Writer Method: (setf how-to-end) ((trial trial))

automatically generated writer method

Source

trial.lisp.

Target Slot

how-to-end.

Generic Reader: indentation (object)
Package

try.

Methods
Reader Method: indentation ((tree-printer tree-printer))

automatically generated reader method

Source

print.lisp.

Target Slot

indentation.

Generic Reader: inner-stream (object)
Package

try.

Methods
Reader Method: inner-stream ((wrapped-stream wrapped-stream))

automatically generated reader method

Source

gray-stream.lisp.

Target Slot

inner-stream.

Generic Reader: line (object)
Package

try.

Methods
Reader Method: line ((line/column-character-output-stream line/column-character-output-stream))

automatically generated reader method

Source

gray-stream.lisp.

Target Slot

line.

Generic Writer: (setf line) (object)
Package

try.

Methods
Writer Method: (setf line) ((line/column-character-output-stream line/column-character-output-stream))

automatically generated writer method

Source

gray-stream.lisp.

Target Slot

line.

Generic Reader: msg (condition)
Package

try.

Methods
Reader Method: msg ((condition result))
Source

result.lisp.

Target Slot

msg.

Generic Reader: nested-error (condition)
Package

try.

Methods
Reader Method: nested-error ((condition try-internal-error))
Source

debug.lisp.

Target Slot

error.

Generic Reader: non-collected-counter (object)
Package

try.

Methods
Reader Method: non-collected-counter ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

non-collected-counter.

Generic Reader: parent (object)
Package

try.

Methods
Reader Method: parent ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

parent.

Generic Reader: print-captures (condition)
Package

try.

Methods
Reader Method: print-captures ((condition result))
Source

result.lisp.

Target Slot

print-captures.

Generic Reader: print-compactly (object)
Package

try.

Methods
Reader Method: print-compactly ((tree-printer tree-printer))

automatically generated reader method

Source

print.lisp.

Target Slot

print-compactly.

Generic Reader: print-duration-p (object)
Package

try.

Methods
Reader Method: print-duration-p ((tree-printer tree-printer))

automatically generated reader method

Source

print.lisp.

Target Slot

print-duration-p.

Generic Function: print-event (printer trial)
Package

try.

Source

print.lisp.

Methods
Method: print-event ((printer tree-printer) (leaf leaf))
Method: print-event ((printer tree-printer) (verdict verdict))
Method: print-event ((printer tree-printer) (event trial-start))
Generic Reader: print-form-memoization-data (condition)
Generic Writer: (setf print-form-memoization-data) (condition)
Package

try.

Methods
Reader Method: print-form-memoization-data ((condition result))
Writer Method: (setf print-form-memoization-data) ((condition result))
Source

result.lisp.

Target Slot

print-form-memoization-data.

Generic Reader: print-parent (object)
Package

try.

Methods
Reader Method: print-parent ((printer printer))

The value of *PRINT-PARENT* when the printer was instantiated.

Source

print.lisp.

Target Slot

print-parent.

Generic Reader: print-type (object)
Package

try.

Methods
Reader Method: print-type ((printer printer))

The PRINT argument of TRY.

Source

print.lisp.

Target Slot

print-type.

Generic Reader: retry-restart (object)
Package

try.

Methods
Reader Method: retry-restart ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

retry-restart.

Generic Writer: (setf retry-restart) (object)
Package

try.

Methods
Writer Method: (setf retry-restart) ((trial trial))

automatically generated writer method

Source

trial.lisp.

Target Slot

retry-restart.

Generic Reader: skip-restart (object)
Package

try.

Methods
Reader Method: skip-restart ((trial trial))

automatically generated reader method

Source

trial.lisp.

Target Slot

skip-restart.

Generic Writer: (setf skip-restart) (object)
Package

try.

Methods
Writer Method: (setf skip-restart) ((trial trial))

automatically generated writer method

Source

trial.lisp.

Target Slot

skip-restart.

Generic Function: stream-column (stream)
Package

try.

Source

gray-stream.lisp.

Methods
Method: stream-column ((stream line/column-character-output-stream))
Generic Function: stream-line (stream)
Package

try.

Source

gray-stream.lisp.

Methods
Method: stream-line ((stream line/column-character-output-stream))
Generic Reader: stream-of (object)
Package

try.

Methods
Reader Method: stream-of ((printer printer))

The stream to which output shall be written.

Source

print.lisp.

Target Slot

stream.

Generic Reader: to-be-described (object)
Package

try.

Methods
Reader Method: to-be-described ((tree-printer tree-printer))

automatically generated reader method

Source

print.lisp.

Target Slot

to-be-described.

Generic Writer: (setf to-be-described) (object)
Package

try.

Methods
Writer Method: (setf to-be-described) ((tree-printer tree-printer))

automatically generated writer method

Source

print.lisp.

Target Slot

to-be-described.

Generic Reader: trial-print-states (object)
Package

try.

Methods
Reader Method: trial-print-states ((printer printer))

A list

Source

print.lisp.

Target Slot

trial-print-states.

Generic Function: write-event (event stream &key terse ctx)
Package

try.

Source

events.lisp.

Methods
Method: write-event ((nlx nlx) stream &key terse ctx)
Source

error.lisp.

Method: write-event ((unhandled-error unhandled-error) stream &key terse ctx)
Source

error.lisp.

Method: write-event ((verdict verdict) stream &key terse ctx)
Source

trial-event.lisp.

Method: write-event ((trial-start trial-start) stream &key terse ctx)
Source

trial-event.lisp.

Method: write-event ((result result) stream &key terse ctx)
Source

result.lisp.

Method: write-event :around (event stream &key terse ctx)

Next: , Previous: , Up: Internals   [Contents][Index]

5.2.5 Conditions

Condition: result-failure
Package

try.

Source

result.lisp.

Direct superclasses
Condition: result-success
Package

try.

Source

result.lisp.

Direct superclasses
Condition: try-internal-error
Package

try.

Source

debug.lisp.

Direct superclasses

serious-condition.

Direct methods

nested-error.

Direct slots
Slot: error
Package

common-lisp.

Initform

(quote nil)

Initargs

:error

Readers

nested-error.

Writers

This slot is read-only.

Condition: verdict-failure
Package

try.

Source

trial-event.lisp.

Direct superclasses
Condition: verdict-success
Package

try.

Source

trial-event.lisp.

Direct superclasses

Next: , Previous: , Up: Internals   [Contents][Index]

5.2.6 Structures

Structure: %collector
Package

try.

Source

collect.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: count-type
Readers

%collector-count-type.

Writers

(setf %collector-count-type).

Slot: collect-type
Readers

%collector-collect-type.

Writers

(setf %collector-collect-type).

Structure: counter
Package

try.

Source

count.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: counts
Readers

counter-counts.

Writers

(setf counter-counts).

Slot: categories
Readers

counter-categories.

Writers

(setf counter-categories).

Structure: print-state
Package

try.

Source

print.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: trial
Readers

print-state-trial.

Writers

(setf print-state-trial).

Slot: n-retries
Readers

print-state-n-retries.

Writers

(setf print-state-n-retries).

Slot: first-line-and-column
Readers

print-state-first-line-and-column.

Writers

(setf print-state-first-line-and-column).


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.7 Classes

Class: dummy-with-print-object
Package

try.

Source

util.lisp.

Direct methods

print-object.

Direct slots
Slot: fn
Initargs

:fn

Class: line/column-character-output-stream
Package

try.

Source

gray-stream.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: line
Initform

0

Readers

line.

Writers

(setf line).

Slot: column
Readers

column.

Writers

(setf column).

Class: printer

PRINTER is the abstract base class for all printers.

Package

try.

Source

print.lisp.

Direct subclasses

tree-printer.

Direct methods
Direct slots
Slot: stream

The stream to which output shall be written.

Package

common-lisp.

Initform

*debug-io*

Initargs

:stream

Readers

stream-of.

Writers

This slot is read-only.

Slot: print-type

The PRINT argument of TRY.

Initform

t

Initargs

:print-type

Readers

print-type.

Writers

This slot is read-only.

Slot: describe-type

The DESCRIBE argument of TRY.

Initform

t

Initargs

:describe-type

Readers

describe-type.

Writers

This slot is read-only.

Slot: print-parent

The value of *PRINT-PARENT* when the printer was instantiated.

Initform

try:*print-parent*

Readers

print-parent.

Writers

This slot is read-only.

Slot: variable-bindings
Initform

(append try:*event-print-bindings* (sb-int:quasiquote ((*package* #s(sb-impl::comma :expr *package* :kind 0)) (try:*categories* #s(sb-impl::comma :expr try:*categories* :kind 0)) (try:*event-print-bindings* nil))))

Slot: trial-print-states

A list

Readers

trial-print-states.

Writers

This slot is read-only.

Class: wrapped-stream
Package

try.

Source

gray-stream.lisp.

Direct superclasses

fundamental-stream.

Direct subclasses

line/column-character-output-stream.

Direct methods
Direct slots
Slot: inner-stream
Initargs

:stream

Readers

inner-stream.

Writers

This slot is read-only.


Previous: , Up: Internals   [Contents][Index]

5.2.8 Types

Type: basic-error*-outcome ()
Package

try.

Source

error.lisp.

Type: basic-outcome ()
Package

try.

Source

outcome.lisp.

Type: valid-type-specifier ()
Package

try.

Source

util.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   L   M   N   O   P   R   S   T   V   W  
Index Entry  Section

%
%%write-result-msg: Private ordinary functions
%collector-collect-type: Private ordinary functions
%collector-count-type: Private ordinary functions
%collector-p: Private ordinary functions
%count-and-collect-event: Private ordinary functions
%describe-condition-for-matching: Private ordinary functions
%ensure-new-line: Private ordinary functions
%ensure-trial-printed: Private ordinary functions
%extract-options: Private ordinary functions
%frob-form-for-printing: Private ordinary functions
%make-counter: Private ordinary functions
%make-indent: Private ordinary functions
%make-rerun-trial-event-handler: Private ordinary functions
%match-condition: Private ordinary functions
%maybe-invoke-debugger: Private ordinary functions
%print-event: Private ordinary functions
%print-indent-for: Private ordinary functions
%print-leaf: Private ordinary functions
%print-verdict: Private ordinary functions
%replay-events: Private ordinary functions
%replay-trial-initargs: Private ordinary functions
%subs-to-bindings: Private ordinary functions
%subs-to-captures: Private ordinary functions
%trial-basic-verdict: Private ordinary functions
%unwind-protect: Private macros
%wrap-restart-bind-binding-in-lambda: Private ordinary functions
%wrap-restart-bind-option-in-lambda: Private ordinary functions
%wrap-restart-case-binding-in-lambda: Private ordinary functions
%wrap-restart-case-option-in-lambda: Private ordinary functions
%write-result: Private ordinary functions
%write-result-captures: Private ordinary functions
%write-result-ctx: Private ordinary functions
%write-result-msg: Private ordinary functions

(
(setf %collector-collect-type): Private ordinary functions
(setf %collector-count-type): Private ordinary functions
(setf abort-restart): Private generic functions
(setf abort-restart): Private generic functions
(setf capture-explicitp): Private ordinary functions
(setf capture-subform): Private ordinary functions
(setf capture-value): Private ordinary functions
(setf capture-valuesp): Private ordinary functions
(setf column): Private generic functions
(setf column): Private generic functions
(setf counter-categories): Private ordinary functions
(setf counter-counts): Private ordinary functions
(setf how-to-end): Private generic functions
(setf how-to-end): Private generic functions
(setf line): Private generic functions
(setf line): Private generic functions
(setf print-form-memoization-data): Private generic functions
(setf print-form-memoization-data): Private generic functions
(setf print-state-first-line-and-column): Private ordinary functions
(setf print-state-n-retries): Private ordinary functions
(setf print-state-trial): Private ordinary functions
(setf retry-restart): Private generic functions
(setf retry-restart): Private generic functions
(setf skip-restart): Private generic functions
(setf skip-restart): Private generic functions
(setf sub-new-form): Public ordinary functions
(setf sub-subform): Public ordinary functions
(setf sub-valuesp): Public ordinary functions
(setf sub-var): Public ordinary functions
(setf to-be-described): Private generic functions
(setf to-be-described): Private generic functions

A
abort-check: Public ordinary functions
abort-restart: Private generic functions
abort-restart: Private generic functions
abort-trial: Public ordinary functions
add-to-counter: Private ordinary functions
add-to-recent-trials: Private ordinary functions
ancestor-trial-names: Private ordinary functions
ancestors-from-oldest: Private ordinary functions
ascii-std-categories: Public ordinary functions

B
backtrace-of: Public generic functions
backtrace-of: Public generic functions
bool=: Private ordinary functions
bump-counter: Private ordinary functions

C
call-lambda-trial: Private ordinary functions
call-named-trial: Private ordinary functions
call-test: Private ordinary functions
call-testable: Private ordinary functions
call-trial: Private ordinary functions
call-try-trial: Private ordinary functions
call-with-wrapper: Private ordinary functions
canonicalize-format-specifier-form: Public ordinary functions
capture: Public macros
capture-explicitp: Private ordinary functions
capture-subform: Private ordinary functions
capture-value: Private ordinary functions
capture-values: Public macros
capture-valuesp: Private ordinary functions
captures: Private generic functions
captures: Private generic functions
categories: Private generic functions
categories: Private generic functions
category-marker: Private ordinary functions
cform: Private generic functions
cform: Private generic functions
check: Private generic functions
check: Private generic functions
check-event-type: Private ordinary functions
check-fails: Private ordinary functions
check-invokes-debugger: Private ordinary functions
check-invokes-debugger-not: Private ordinary functions
check-printer-arg: Private ordinary functions
check-signals: Private ordinary functions
check-signals-not: Private ordinary functions
check-trial-running: Private ordinary functions
child-trials: Private ordinary functions
children: Public generic functions
children: Public generic functions
clean-up-cancelled-nlx-of-retry-for-end-trial: Private ordinary functions
clear-trial-restarts: Private ordinary functions
close: Public standalone methods
column: Private generic functions
column: Private generic functions
combine-superclasses: Private ordinary functions
compile-wrapper: Public ordinary functions
compiler-policy: Private ordinary functions
compiler-policy-quantity: Private ordinary functions
condition-match-checker: Private macros
constantishp: Private ordinary functions
copy-%collector: Private ordinary functions
copy-capture: Private ordinary functions
copy-counter: Private ordinary functions
copy-print-state: Private ordinary functions
copy-sub: Private ordinary functions
count-and-collect-leaf: Private ordinary functions
count-and-collect-verdict: Private ordinary functions
count-collected-leaf: Private ordinary functions
count-collected-verdict: Private ordinary functions
count-non-collected-leaf: Private ordinary functions
count-non-collected-verdict: Private ordinary functions
count-of: Private generic functions
count-of: Private generic functions
count-trial-start: Private ordinary functions
counter: Private generic functions
counter: Private generic functions
counter-categories: Private ordinary functions
counter-counts: Private ordinary functions
counter-p: Private ordinary functions
ctx: Private generic functions
ctx: Private generic functions
current-trial: Public ordinary functions

D
dbg: Private macros
debugger-invoked-p: Public generic functions
debugger-invoked-p: Public generic functions
defer-describe: Private generic functions
defer-describe: Private generic functions
define-combi-event: Private macros
define-macrolet: Private macros
deftest: Public macros
deftest-registry-var-name: Private ordinary functions
depth: Private generic functions
depth: Private generic functions
describe-condition: Private ordinary functions
describe-leaf: Private generic functions
describe-leaf: Private generic functions
describe-to-be-described: Private ordinary functions
describe-type: Private generic functions
describe-type: Private generic functions
determine-outcome-type: Private ordinary functions
different-elements: Public ordinary functions
double-float-~=: Private ordinary functions

E
elapsed-seconds: Private generic functions
elapsed-seconds: Private generic functions
elapsed-seconds: Private generic functions
elapsed-seconds: Private generic functions
end-trial: Private ordinary functions
ensure-deftest-registry: Private ordinary functions
ensure-list: Private ordinary functions
ensure-rest-arg: Private ordinary functions
event-category: Private ordinary functions
event-print-depth: Private ordinary functions
expand-with-trial-in-deftest-p: Private ordinary functions
extra-message: Private generic functions
extra-message: Private generic functions

F
failedp: Public ordinary functions
fails: Public macros
fancy-std-categories: Public ordinary functions
finish-printing: Private generic functions
finish-printing: Private generic functions
finish-printing: Private generic functions
float-~<: Public ordinary functions
float-~=: Public ordinary functions
float-~>: Public ordinary functions
force-expected-failure: Public ordinary functions
force-expected-success: Public ordinary functions
force-unexpected-failure: Public ordinary functions
force-unexpected-success: Public ordinary functions
Function, %%write-result-msg: Private ordinary functions
Function, %collector-collect-type: Private ordinary functions
Function, %collector-count-type: Private ordinary functions
Function, %collector-p: Private ordinary functions
Function, %count-and-collect-event: Private ordinary functions
Function, %describe-condition-for-matching: Private ordinary functions
Function, %ensure-new-line: Private ordinary functions
Function, %ensure-trial-printed: Private ordinary functions
Function, %extract-options: Private ordinary functions
Function, %frob-form-for-printing: Private ordinary functions
Function, %make-counter: Private ordinary functions
Function, %make-indent: Private ordinary functions
Function, %make-rerun-trial-event-handler: Private ordinary functions
Function, %match-condition: Private ordinary functions
Function, %maybe-invoke-debugger: Private ordinary functions
Function, %print-event: Private ordinary functions
Function, %print-indent-for: Private ordinary functions
Function, %print-leaf: Private ordinary functions
Function, %print-verdict: Private ordinary functions
Function, %replay-events: Private ordinary functions
Function, %replay-trial-initargs: Private ordinary functions
Function, %subs-to-bindings: Private ordinary functions
Function, %subs-to-captures: Private ordinary functions
Function, %trial-basic-verdict: Private ordinary functions
Function, %wrap-restart-bind-binding-in-lambda: Private ordinary functions
Function, %wrap-restart-bind-option-in-lambda: Private ordinary functions
Function, %wrap-restart-case-binding-in-lambda: Private ordinary functions
Function, %wrap-restart-case-option-in-lambda: Private ordinary functions
Function, %write-result: Private ordinary functions
Function, %write-result-captures: Private ordinary functions
Function, %write-result-ctx: Private ordinary functions
Function, %write-result-msg: Private ordinary functions
Function, (setf %collector-collect-type): Private ordinary functions
Function, (setf %collector-count-type): Private ordinary functions
Function, (setf capture-explicitp): Private ordinary functions
Function, (setf capture-subform): Private ordinary functions
Function, (setf capture-value): Private ordinary functions
Function, (setf capture-valuesp): Private ordinary functions
Function, (setf counter-categories): Private ordinary functions
Function, (setf counter-counts): Private ordinary functions
Function, (setf print-state-first-line-and-column): Private ordinary functions
Function, (setf print-state-n-retries): Private ordinary functions
Function, (setf print-state-trial): Private ordinary functions
Function, (setf sub-new-form): Public ordinary functions
Function, (setf sub-subform): Public ordinary functions
Function, (setf sub-valuesp): Public ordinary functions
Function, (setf sub-var): Public ordinary functions
Function, abort-check: Public ordinary functions
Function, abort-trial: Public ordinary functions
Function, add-to-counter: Private ordinary functions
Function, add-to-recent-trials: Private ordinary functions
Function, ancestor-trial-names: Private ordinary functions
Function, ancestors-from-oldest: Private ordinary functions
Function, ascii-std-categories: Public ordinary functions
Function, bool=: Private ordinary functions
Function, bump-counter: Private ordinary functions
Function, call-lambda-trial: Private ordinary functions
Function, call-named-trial: Private ordinary functions
Function, call-test: Private ordinary functions
Function, call-testable: Private ordinary functions
Function, call-trial: Private ordinary functions
Function, call-try-trial: Private ordinary functions
Function, call-with-wrapper: Private ordinary functions
Function, canonicalize-format-specifier-form: Public ordinary functions
Function, capture-explicitp: Private ordinary functions
Function, capture-subform: Private ordinary functions
Function, capture-value: Private ordinary functions
Function, capture-valuesp: Private ordinary functions
Function, category-marker: Private ordinary functions
Function, check-event-type: Private ordinary functions
Function, check-fails: Private ordinary functions
Function, check-invokes-debugger: Private ordinary functions
Function, check-invokes-debugger-not: Private ordinary functions
Function, check-printer-arg: Private ordinary functions
Function, check-signals: Private ordinary functions
Function, check-signals-not: Private ordinary functions
Function, check-trial-running: Private ordinary functions
Function, child-trials: Private ordinary functions
Function, clean-up-cancelled-nlx-of-retry-for-end-trial: Private ordinary functions
Function, clear-trial-restarts: Private ordinary functions
Function, combine-superclasses: Private ordinary functions
Function, compile-wrapper: Public ordinary functions
Function, compiler-policy: Private ordinary functions
Function, compiler-policy-quantity: Private ordinary functions
Function, constantishp: Private ordinary functions
Function, copy-%collector: Private ordinary functions
Function, copy-capture: Private ordinary functions
Function, copy-counter: Private ordinary functions
Function, copy-print-state: Private ordinary functions
Function, copy-sub: Private ordinary functions
Function, count-and-collect-leaf: Private ordinary functions
Function, count-and-collect-verdict: Private ordinary functions
Function, count-collected-leaf: Private ordinary functions
Function, count-collected-verdict: Private ordinary functions
Function, count-non-collected-leaf: Private ordinary functions
Function, count-non-collected-verdict: Private ordinary functions
Function, count-trial-start: Private ordinary functions
Function, counter-categories: Private ordinary functions
Function, counter-counts: Private ordinary functions
Function, counter-p: Private ordinary functions
Function, current-trial: Public ordinary functions
Function, deftest-registry-var-name: Private ordinary functions
Function, describe-condition: Private ordinary functions
Function, describe-to-be-described: Private ordinary functions
Function, determine-outcome-type: Private ordinary functions
Function, different-elements: Public ordinary functions
Function, double-float-~=: Private ordinary functions
Function, end-trial: Private ordinary functions
Function, ensure-deftest-registry: Private ordinary functions
Function, ensure-list: Private ordinary functions
Function, ensure-rest-arg: Private ordinary functions
Function, event-category: Private ordinary functions
Function, event-print-depth: Private ordinary functions
Function, expand-with-trial-in-deftest-p: Private ordinary functions
Function, failedp: Public ordinary functions
Function, fancy-std-categories: Public ordinary functions
Function, float-~<: Public ordinary functions
Function, float-~=: Public ordinary functions
Function, float-~>: Public ordinary functions
Function, force-expected-failure: Public ordinary functions
Function, force-expected-success: Public ordinary functions
Function, force-unexpected-failure: Public ordinary functions
Function, force-unexpected-success: Public ordinary functions
Function, get-deftest-registry: Private ordinary functions
Function, get-elapsed-seconds: Private ordinary functions
Function, intern-hyphenated: Private ordinary functions
Function, invoke-test-interactively: Private ordinary functions
Function, invokes-debugger-default-ctx: Private ordinary functions
Function, invokes-debugger-default-msg: Private ordinary functions
Function, invokes-debugger-not-default-msg: Private ordinary functions
Function, lambda-list-to-arglist-form: Private ordinary functions
Function, lambda-list-with-&rest-to-arglist-form: Private ordinary functions
Function, lambda-trial-p: Private ordinary functions
Function, list-function-designators: Private ordinary functions
Function, list-package-tests: Public ordinary functions
Function, make-%collector: Private ordinary functions
Function, make-capture: Private ordinary functions
Function, make-counter: Private ordinary functions
Function, make-gensym: Private ordinary functions
Function, make-print-state: Private ordinary functions
Function, make-sub: Public ordinary functions
Function, make-trial: Private ordinary functions
Function, maybe-backtrace: Private ordinary functions
Function, maybe-mark-test-run: Private ordinary functions
Function, mismatch%: Public ordinary functions
Function, named-trial-p: Private ordinary functions
Function, passedp: Public ordinary functions
Function, present-body: Private ordinary functions
Function, print-duration: Private ordinary functions
Function, print-event-header: Private ordinary functions
Function, print-state-first-line-and-column: Private ordinary functions
Function, print-state-n-retries: Private ordinary functions
Function, print-state-p: Private ordinary functions
Function, print-state-trial: Private ordinary functions
Function, print-state-trial-printed-p: Private ordinary functions
Function, printer-depth: Private ordinary functions
Function, read-argument-list: Private ordinary functions
Function, read-try-debug: Private ordinary functions
Function, recent-trial: Public ordinary functions
Function, record-event: Public ordinary functions
Function, register-deftest: Private ordinary functions
Function, replay-events: Public ordinary functions
Function, report-change-outcome-to: Private ordinary functions
Function, reset-counter: Private ordinary functions
Function, retry-check: Public ordinary functions
Function, retry-trial: Public ordinary functions
Function, runningp: Public ordinary functions
Function, safe-subtypep: Private ordinary functions
Function, safe-typep: Private ordinary functions
Function, same-but-different-implicit-captures-p: Private ordinary functions
Function, say-how-to-end: Private ordinary functions
Function, scrub-captures: Private ordinary functions
Function, set-try-debug: Public ordinary functions
Function, set-up-trial-restarts: Private ordinary functions
Function, shuffle: Private ordinary functions
Function, shuffle!: Private ordinary functions
Function, shuffle-vector!: Private ordinary functions
Function, signal-error*: Private ordinary functions
Function, signal-outcome: Private ordinary functions
Function, signal-with-record-event: Private ordinary functions
Function, single-float-~=: Private ordinary functions
Function, skip-check: Public ordinary functions
Function, skip-trial: Public ordinary functions
Function, start-retry-for-trial: Private ordinary functions
Function, start-trial: Private ordinary functions
Function, stream-line-column*: Private ordinary functions
Function, strip-outer-%-and-%%-from-implicit-captures: Private ordinary functions
Function, sub-new-form: Public ordinary functions
Function, sub-p: Private ordinary functions
Function, sub-subform: Public ordinary functions
Function, sub-valuesp: Public ordinary functions
Function, sub-var: Public ordinary functions
Function, subseq*: Private ordinary functions
Function, substitute-args: Private ordinary functions
Function, substitute-in-subs: Private ordinary functions
Function, substitute-is-form: Private ordinary functions
Function, substitute-tilde-percent: Private ordinary functions
Function, sync-stream-line-column: Private ordinary functions
Function, test-bound-p: Public ordinary functions
Function, trial-call-=: Private ordinary functions
Function, trial-has-event-of-type-p: Private ordinary functions
Function, trial-printed-p: Private ordinary functions
Function, trialp: Private ordinary functions
Function, try: Public ordinary functions
Function, try-trial-p: Private ordinary functions
Function, try-trial-testable: Private ordinary functions
Function, try/implicit: Private ordinary functions
Function, valid-type-specifier-p: Private ordinary functions
Function, verdict-for-trial-p: Private ordinary functions
Function, write-trial-counts: Private ordinary functions

G
Generic Function, (setf abort-restart): Private generic functions
Generic Function, (setf column): Private generic functions
Generic Function, (setf how-to-end): Private generic functions
Generic Function, (setf line): Private generic functions
Generic Function, (setf print-form-memoization-data): Private generic functions
Generic Function, (setf retry-restart): Private generic functions
Generic Function, (setf skip-restart): Private generic functions
Generic Function, (setf to-be-described): Private generic functions
Generic Function, abort-restart: Private generic functions
Generic Function, backtrace-of: Public generic functions
Generic Function, captures: Private generic functions
Generic Function, categories: Private generic functions
Generic Function, cform: Private generic functions
Generic Function, check: Private generic functions
Generic Function, children: Public generic functions
Generic Function, column: Private generic functions
Generic Function, count-of: Private generic functions
Generic Function, counter: Private generic functions
Generic Function, ctx: Private generic functions
Generic Function, debugger-invoked-p: Public generic functions
Generic Function, defer-describe: Private generic functions
Generic Function, depth: Private generic functions
Generic Function, describe-leaf: Private generic functions
Generic Function, describe-type: Private generic functions
Generic Function, elapsed-seconds: Private generic functions
Generic Function, extra-message: Private generic functions
Generic Function, finish-printing: Private generic functions
Generic Function, has-non-collected-failed-child-p: Private generic functions
Generic Function, how-it-ended: Private generic functions
Generic Function, how-to-end: Private generic functions
Generic Function, indentation: Private generic functions
Generic Function, inner-stream: Private generic functions
Generic Function, line: Private generic functions
Generic Function, msg: Private generic functions
Generic Function, n-retries: Public generic functions
Generic Function, nested-condition: Public generic functions
Generic Function, nested-error: Private generic functions
Generic Function, non-collected-counter: Private generic functions
Generic Function, parent: Private generic functions
Generic Function, print-captures: Private generic functions
Generic Function, print-compactly: Private generic functions
Generic Function, print-duration-p: Private generic functions
Generic Function, print-event: Private generic functions
Generic Function, print-form-memoization-data: Private generic functions
Generic Function, print-parent: Private generic functions
Generic Function, print-type: Private generic functions
Generic Function, retry-restart: Private generic functions
Generic Function, skip-restart: Private generic functions
Generic Function, stream-column: Private generic functions
Generic Function, stream-line: Private generic functions
Generic Function, stream-of: Private generic functions
Generic Function, substitute-is-list-form: Public generic functions
Generic Function, test-name: Public generic functions
Generic Function, to-be-described: Private generic functions
Generic Function, trial: Public generic functions
Generic Function, trial-print-states: Private generic functions
Generic Function, trial-start: Public generic functions
Generic Function, verdict: Public generic functions
Generic Function, write-event: Private generic functions
get-deftest-registry: Private ordinary functions
get-elapsed-seconds: Private ordinary functions

H
has-non-collected-failed-child-p: Private generic functions
has-non-collected-failed-child-p: Private generic functions
how-it-ended: Private generic functions
how-it-ended: Private generic functions
how-to-end: Private generic functions
how-to-end: Private generic functions

I
in-time: Public macros
indentation: Private generic functions
indentation: Private generic functions
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods
initialize-instance: Public standalone methods
inner-stream: Private generic functions
inner-stream: Private generic functions
intern-hyphenated: Private ordinary functions
invoke-test-interactively: Private ordinary functions
invokes-debugger: Public macros
invokes-debugger-default-ctx: Private ordinary functions
invokes-debugger-default-msg: Private ordinary functions
invokes-debugger-not: Public macros
invokes-debugger-not-default-msg: Private ordinary functions
is: Public macros

L
lambda-list-to-arglist-form: Private ordinary functions
lambda-list-with-&rest-to-arglist-form: Private ordinary functions
lambda-trial-p: Private ordinary functions
line: Private generic functions
line: Private generic functions
list-function-designators: Private ordinary functions
list-package-tests: Public ordinary functions

M
Macro, %unwind-protect: Private macros
Macro, capture: Public macros
Macro, capture-values: Public macros
Macro, condition-match-checker: Private macros
Macro, dbg: Private macros
Macro, define-combi-event: Private macros
Macro, define-macrolet: Private macros
Macro, deftest: Public macros
Macro, fails: Public macros
Macro, in-time: Public macros
Macro, invokes-debugger: Public macros
Macro, invokes-debugger-not: Public macros
Macro, is: Public macros
Macro, match-values: Public macros
Macro, match-values%: Private macros
Macro, on-finish: Private macros
Macro, on-nlx: Private macros
Macro, on-return: Private macros
Macro, on-values: Public macros
Macro, remembering-most-recent-trials: Private macros
Macro, restart-bind: Private macros
Macro, restart-case: Private macros
Macro, signals: Public macros
Macro, signals-not: Public macros
Macro, try-default-unspecified-args: Private macros
Macro, warn-on-tests-not-run: Public macros
Macro, with-bindings: Private macros
Macro, with-circularity-detection: Private macros
Macro, with-condition-matching: Private macros
Macro, with-current-debug: Private macros
Macro, with-debugger-hook: Private macros
Macro, with-debugger-hook-form: Private macros
Macro, with-error*-handled: Private macros
Macro, with-expected-outcome: Public macros
Macro, with-failure-expected: Public macros
Macro, with-gensyms: Private macros
Macro, with-internal-errors: Private macros
Macro, with-retry: Private macros
Macro, with-retry/catch: Private macros
Macro, with-shuffling: Public macros
Macro, with-skip: Public macros
Macro, with-test: Public macros
Macro, with-tests-run: Public macros
Macro, with-timing: Private macros
Macro, with-trial: Private macros
Macro, with-trial-restarts: Private macros
Macro, with-try-context: Private macros
Macro, without-tail-call: Private macros
Macro, wrap-trial-body-for-return: Private macros
make-%collector: Private ordinary functions
make-capture: Private ordinary functions
make-counter: Private ordinary functions
make-gensym: Private ordinary functions
make-print-state: Private ordinary functions
make-sub: Public ordinary functions
make-trial: Private ordinary functions
match-values: Public macros
match-values%: Private macros
maybe-backtrace: Private ordinary functions
maybe-mark-test-run: Private ordinary functions
Method, (setf abort-restart): Private generic functions
Method, (setf column): Private generic functions
Method, (setf how-to-end): Private generic functions
Method, (setf line): Private generic functions
Method, (setf print-form-memoization-data): Private generic functions
Method, (setf retry-restart): Private generic functions
Method, (setf skip-restart): Private generic functions
Method, (setf to-be-described): Private generic functions
Method, abort-restart: Private generic functions
Method, backtrace-of: Public generic functions
Method, captures: Private generic functions
Method, categories: Private generic functions
Method, cform: Private generic functions
Method, check: Private generic functions
Method, children: Public generic functions
Method, close: Public standalone methods
Method, column: Private generic functions
Method, count-of: Private generic functions
Method, counter: Private generic functions
Method, ctx: Private generic functions
Method, debugger-invoked-p: Public generic functions
Method, defer-describe: Private generic functions
Method, depth: Private generic functions
Method, describe-leaf: Private generic functions
Method, describe-type: Private generic functions
Method, elapsed-seconds: Private generic functions
Method, elapsed-seconds: Private generic functions
Method, elapsed-seconds: Private generic functions
Method, extra-message: Private generic functions
Method, finish-printing: Private generic functions
Method, finish-printing: Private generic functions
Method, has-non-collected-failed-child-p: Private generic functions
Method, how-it-ended: Private generic functions
Method, how-to-end: Private generic functions
Method, indentation: Private generic functions
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, initialize-instance: Public standalone methods
Method, inner-stream: Private generic functions
Method, line: Private generic functions
Method, msg: Private generic functions
Method, n-retries: Public generic functions
Method, nested-condition: Public generic functions
Method, nested-error: Private generic functions
Method, non-collected-counter: Private generic functions
Method, parent: Private generic functions
Method, print-captures: Private generic functions
Method, print-compactly: Private generic functions
Method, print-duration-p: Private generic functions
Method, print-event: Private generic functions
Method, print-event: Private generic functions
Method, print-event: Private generic functions
Method, print-form-memoization-data: Private generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-parent: Private generic functions
Method, print-type: Private generic functions
Method, retry-restart: Private generic functions
Method, skip-restart: Private generic functions
Method, stream-column: Private generic functions
Method, stream-element-type: Public standalone methods
Method, stream-line: Private generic functions
Method, stream-line-column: Public standalone methods
Method, stream-of: Private generic functions
Method, stream-write-char: Public standalone methods
Method, substitute-is-list-form: Public generic functions
Method, substitute-is-list-form: Public generic functions
Method, substitute-is-list-form: Public generic functions
Method, substitute-is-list-form: Public generic functions
Method, substitute-is-list-form: Public generic functions
Method, test-name: Public generic functions
Method, test-name: Public generic functions
Method, to-be-described: Private generic functions
Method, trial: Public generic functions
Method, trial-print-states: Private generic functions
Method, trial-start: Public generic functions
Method, verdict: Public generic functions
Method, write-event: Private generic functions
Method, write-event: Private generic functions
Method, write-event: Private generic functions
Method, write-event: Private generic functions
Method, write-event: Private generic functions
Method, write-event: Private generic functions
mismatch%: Public ordinary functions
msg: Private generic functions
msg: Private generic functions

N
n-retries: Public generic functions
n-retries: Public generic functions
named-trial-p: Private ordinary functions
nested-condition: Public generic functions
nested-condition: Public generic functions
nested-error: Private generic functions
nested-error: Private generic functions
non-collected-counter: Private generic functions
non-collected-counter: Private generic functions

O
on-finish: Private macros
on-nlx: Private macros
on-return: Private macros
on-values: Public macros

P
parent: Private generic functions
parent: Private generic functions
passedp: Public ordinary functions
present-body: Private ordinary functions
print-captures: Private generic functions
print-captures: Private generic functions
print-compactly: Private generic functions
print-compactly: Private generic functions
print-duration: Private ordinary functions
print-duration-p: Private generic functions
print-duration-p: Private generic functions
print-event: Private generic functions
print-event: Private generic functions
print-event: Private generic functions
print-event: Private generic functions
print-event-header: Private ordinary functions
print-form-memoization-data: Private generic functions
print-form-memoization-data: Private generic functions
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-parent: Private generic functions
print-parent: Private generic functions
print-state-first-line-and-column: Private ordinary functions
print-state-n-retries: Private ordinary functions
print-state-p: Private ordinary functions
print-state-trial: Private ordinary functions
print-state-trial-printed-p: Private ordinary functions
print-type: Private generic functions
print-type: Private generic functions
printer-depth: Private ordinary functions

R
read-argument-list: Private ordinary functions
read-try-debug: Private ordinary functions
recent-trial: Public ordinary functions
record-event: Public ordinary functions
register-deftest: Private ordinary functions
remembering-most-recent-trials: Private macros
replay-events: Public ordinary functions
report-change-outcome-to: Private ordinary functions
reset-counter: Private ordinary functions
restart-bind: Private macros
restart-case: Private macros
retry-check: Public ordinary functions
retry-restart: Private generic functions
retry-restart: Private generic functions
retry-trial: Public ordinary functions
runningp: Public ordinary functions

S
safe-subtypep: Private ordinary functions
safe-typep: Private ordinary functions
same-but-different-implicit-captures-p: Private ordinary functions
say-how-to-end: Private ordinary functions
scrub-captures: Private ordinary functions
set-try-debug: Public ordinary functions
set-up-trial-restarts: Private ordinary functions
shuffle: Private ordinary functions
shuffle!: Private ordinary functions
shuffle-vector!: Private ordinary functions
signal-error*: Private ordinary functions
signal-outcome: Private ordinary functions
signal-with-record-event: Private ordinary functions
signals: Public macros
signals-not: Public macros
single-float-~=: Private ordinary functions
skip-check: Public ordinary functions
skip-restart: Private generic functions
skip-restart: Private generic functions
skip-trial: Public ordinary functions
start-retry-for-trial: Private ordinary functions
start-trial: Private ordinary functions
stream-column: Private generic functions
stream-column: Private generic functions
stream-element-type: Public standalone methods
stream-line: Private generic functions
stream-line: Private generic functions
stream-line-column: Public standalone methods
stream-line-column*: Private ordinary functions
stream-of: Private generic functions
stream-of: Private generic functions
stream-write-char: Public standalone methods
strip-outer-%-and-%%-from-implicit-captures: Private ordinary functions
sub-new-form: Public ordinary functions
sub-p: Private ordinary functions
sub-subform: Public ordinary functions
sub-valuesp: Public ordinary functions
sub-var: Public ordinary functions
subseq*: Private ordinary functions
substitute-args: Private ordinary functions
substitute-in-subs: Private ordinary functions
substitute-is-form: Private ordinary functions
substitute-is-list-form: Public generic functions
substitute-is-list-form: Public generic functions
substitute-is-list-form: Public generic functions
substitute-is-list-form: Public generic functions
substitute-is-list-form: Public generic functions
substitute-is-list-form: Public generic functions
substitute-tilde-percent: Private ordinary functions
sync-stream-line-column: Private ordinary functions

T
test-bound-p: Public ordinary functions
test-name: Public generic functions
test-name: Public generic functions
test-name: Public generic functions
to-be-described: Private generic functions
to-be-described: Private generic functions
trial: Public generic functions
trial: Public generic functions
trial-call-=: Private ordinary functions
trial-has-event-of-type-p: Private ordinary functions
trial-print-states: Private generic functions
trial-print-states: Private generic functions
trial-printed-p: Private ordinary functions
trial-start: Public generic functions
trial-start: Public generic functions
trialp: Private ordinary functions
try: Public ordinary functions
try-default-unspecified-args: Private macros
try-trial-p: Private ordinary functions
try-trial-testable: Private ordinary functions
try/implicit: Private ordinary functions

V
valid-type-specifier-p: Private ordinary functions
verdict: Public generic functions
verdict: Public generic functions
verdict-for-trial-p: Private ordinary functions

W
warn-on-tests-not-run: Public macros
with-bindings: Private macros
with-circularity-detection: Private macros
with-condition-matching: Private macros
with-current-debug: Private macros
with-debugger-hook: Private macros
with-debugger-hook-form: Private macros
with-error*-handled: Private macros
with-expected-outcome: Public macros
with-failure-expected: Public macros
with-gensyms: Private macros
with-internal-errors: Private macros
with-retry: Private macros
with-retry/catch: Private macros
with-shuffling: Public macros
with-skip: Public macros
with-test: Public macros
with-tests-run: Public macros
with-timing: Private macros
with-trial: Private macros
with-trial-restarts: Private macros
with-try-context: Private macros
without-tail-call: Private macros
wrap-trial-body-for-return: Private macros
write-event: Private generic functions
write-event: Private generic functions
write-event: Private generic functions
write-event: Private generic functions
write-event: Private generic functions
write-event: Private generic functions
write-event: Private generic functions
write-trial-counts: Private ordinary functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   L   M   N   O   P   R   S   T   V   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   !   *   @  
A   B   C   D   E   F   H   I   L   M   N   P   R   S   T   V  
Index Entry  Section

!
!: Public special variables
!!: Public special variables
!!!: Public special variables

*
*best-matching-condition*: Public special variables
*call-test*: Private special variables
*call-test-fn*: Private special variables
*categories*: Public special variables
*collect*: Public special variables
*condition-matched-p*: Public special variables
*count*: Public special variables
*dbg*: Private special variables
*debug*: Public special variables
*defer-describe*: Public special variables
*describe*: Public special variables
*dummy*: Private special variables
*event-print-bindings*: Public special variables
*expected-outcome*: Private special variables
*gather-backtrace*: Public special variables
*in-time-elapsed-seconds*: Public special variables
*internal-error*: Private special variables
*invoking-debugger*: Private special variables
*is-captures*: Public special variables
*is-form*: Public special variables
*max-diff-in-ulp*: Public special variables
*max-diff-in-value*: Public special variables
*n-recent-trials*: Public special variables
*print*: Public special variables
*print-backtrace*: Private special variables
*print-compactly*: Public special variables
*print-duration*: Public special variables
*print-indentation*: Public special variables
*print-parent*: Public special variables
*printer*: Public special variables
*recent-trials*: Private special variables
*record-event*: Private special variables
*rerun*: Public special variables
*run-deftest-when*: Public special variables
*skip*: Private special variables
*start-time*: Private special variables
*stream*: Public special variables
*testing-timing*: Private special variables
*tests-run*: Private special variables
*trial*: Private special variables
*trial-initargs*: Private special variables
*try-collect*: Public special variables
*try-count*: Public special variables
*try-debug*: Public special variables
*try-describe*: Public special variables
*try-id*: Private special variables
*try-print*: Public special variables
*try-printer*: Public special variables
*try-rerun*: Public special variables
*try-stream*: Public special variables

@
@cancelled-nlx: Private special variables
@funcallable-instance: Private special variables
@function-designator: Private special variables
@non-local-exit: Private special variables
@try-manual: Public special variables
@try/automatic-captures: Public special variables
@try/captures: Public special variables
@try/categories: Public special variables
@try/check-library: Public special variables
@try/check-restarts: Public special variables
@try/check-utilities: Public special variables
@try/checking-conditions: Public special variables
@try/checks: Public special variables
@try/collect: Public special variables
@try/comparing-floats: Public special variables
@try/concrete-events: Public special variables
@try/count: Public special variables
@try/errors: Public special variables
@try/event-glue: Public special variables
@try/event-restarts: Public special variables
@try/events: Public special variables
@try/explicit-captures: Public special variables
@try/explicit-try: Public special variables
@try/format-specifier-forms: Public special variables
@try/glossary: Public special variables
@try/implementation-notes: Public special variables
@try/implicit-try: Public special variables
@try/implicit-try-implementation: Public special variables
@try/is: Public special variables
@try/links: Public special variables
@try/middle-layer-of-events: Public special variables
@try/misc-checks: Public special variables
@try/outcome-restarts: Public special variables
@try/outcomes: Public special variables
@try/print: Public special variables
@try/printing-events: Public special variables
@try/replay: Public special variables
@try/rerun: Public special variables
@try/testables: Public special variables
@try/tests: Public special variables
@try/trial-events: Public special variables
@try/trial-restarts: Public special variables
@try/trial-verdicts: Public special variables
@try/trials: Public special variables
@try/tutorial: Public special variables
@try/writing-automatic-capture-rules: Public special variables

A
abort-restart: Public classes

B
backtrace: Public conditions

C
captures: Public conditions
categories: Public classes
categories: Private structures
cform: Public classes
check: Public conditions
children: Public classes
collect-type: Private structures
column: Private classes
count: Public classes
count-type: Private structures
counter: Public classes
counts: Private structures
ctx: Public conditions

D
debugger-invoked-p: Public conditions
defer-describe: Public classes
depth: Public classes
describe-type: Private classes

E
elapsed-seconds: Public conditions
elapsed-seconds: Public conditions
elapsed-seconds: Public classes
error: Private conditions
extra-message: Public conditions

F
first-line-and-column: Private structures
fn: Private classes

H
has-non-collected-failed-child-p: Public classes
how-it-ended: Public classes
how-to-end: Public classes

I
indentation: Public classes
inner-stream: Private classes

L
line: Private classes

M
msg: Public conditions

N
n-retries: Public classes
n-retries: Private structures
nested-condition: Public conditions
new-form: Public structures
non-collected-counter: Public classes

P
parent: Public classes
print-captures: Public conditions
print-compactly: Public classes
print-duration-p: Public classes
print-form-memoization-data: Public conditions
print-parent: Private classes
print-type: Private classes

R
retry-restart: Public classes

S
skip-restart: Public classes
Slot, abort-restart: Public classes
Slot, backtrace: Public conditions
Slot, captures: Public conditions
Slot, categories: Public classes
Slot, categories: Private structures
Slot, cform: Public classes
Slot, check: Public conditions
Slot, children: Public classes
Slot, collect-type: Private structures
Slot, column: Private classes
Slot, count: Public classes
Slot, count-type: Private structures
Slot, counter: Public classes
Slot, counts: Private structures
Slot, ctx: Public conditions
Slot, debugger-invoked-p: Public conditions
Slot, defer-describe: Public classes
Slot, depth: Public classes
Slot, describe-type: Private classes
Slot, elapsed-seconds: Public conditions
Slot, elapsed-seconds: Public conditions
Slot, elapsed-seconds: Public classes
Slot, error: Private conditions
Slot, extra-message: Public conditions
Slot, first-line-and-column: Private structures
Slot, fn: Private classes
Slot, has-non-collected-failed-child-p: Public classes
Slot, how-it-ended: Public classes
Slot, how-to-end: Public classes
Slot, indentation: Public classes
Slot, inner-stream: Private classes
Slot, line: Private classes
Slot, msg: Public conditions
Slot, n-retries: Public classes
Slot, n-retries: Private structures
Slot, nested-condition: Public conditions
Slot, new-form: Public structures
Slot, non-collected-counter: Public classes
Slot, parent: Public classes
Slot, print-captures: Public conditions
Slot, print-compactly: Public classes
Slot, print-duration-p: Public classes
Slot, print-form-memoization-data: Public conditions
Slot, print-parent: Private classes
Slot, print-type: Private classes
Slot, retry-restart: Public classes
Slot, skip-restart: Public classes
Slot, stream: Private classes
Slot, subform: Public structures
Slot, test-name: Public conditions
Slot, test-name: Public classes
Slot, to-be-described: Public classes
Slot, trial: Public conditions
Slot, trial: Private structures
Slot, trial-print-states: Private classes
Slot, trial-start: Public classes
Slot, valuesp: Public structures
Slot, var: Public structures
Slot, variable-bindings: Private classes
Slot, verdict: Public classes
Special Variable, !: Public special variables
Special Variable, !!: Public special variables
Special Variable, !!!: Public special variables
Special Variable, *best-matching-condition*: Public special variables
Special Variable, *call-test*: Private special variables
Special Variable, *call-test-fn*: Private special variables
Special Variable, *categories*: Public special variables
Special Variable, *collect*: Public special variables
Special Variable, *condition-matched-p*: Public special variables
Special Variable, *count*: Public special variables
Special Variable, *dbg*: Private special variables
Special Variable, *debug*: Public special variables
Special Variable, *defer-describe*: Public special variables
Special Variable, *describe*: Public special variables
Special Variable, *dummy*: Private special variables
Special Variable, *event-print-bindings*: Public special variables
Special Variable, *expected-outcome*: Private special variables
Special Variable, *gather-backtrace*: Public special variables
Special Variable, *in-time-elapsed-seconds*: Public special variables
Special Variable, *internal-error*: Private special variables
Special Variable, *invoking-debugger*: Private special variables
Special Variable, *is-captures*: Public special variables
Special Variable, *is-form*: Public special variables
Special Variable, *max-diff-in-ulp*: Public special variables
Special Variable, *max-diff-in-value*: Public special variables
Special Variable, *n-recent-trials*: Public special variables
Special Variable, *print*: Public special variables
Special Variable, *print-backtrace*: Private special variables
Special Variable, *print-compactly*: Public special variables
Special Variable, *print-duration*: Public special variables
Special Variable, *print-indentation*: Public special variables
Special Variable, *print-parent*: Public special variables
Special Variable, *printer*: Public special variables
Special Variable, *recent-trials*: Private special variables
Special Variable, *record-event*: Private special variables
Special Variable, *rerun*: Public special variables
Special Variable, *run-deftest-when*: Public special variables
Special Variable, *skip*: Private special variables
Special Variable, *start-time*: Private special variables
Special Variable, *stream*: Public special variables
Special Variable, *testing-timing*: Private special variables
Special Variable, *tests-run*: Private special variables
Special Variable, *trial*: Private special variables
Special Variable, *trial-initargs*: Private special variables
Special Variable, *try-collect*: Public special variables
Special Variable, *try-count*: Public special variables
Special Variable, *try-debug*: Public special variables
Special Variable, *try-describe*: Public special variables
Special Variable, *try-id*: Private special variables
Special Variable, *try-print*: Public special variables
Special Variable, *try-printer*: Public special variables
Special Variable, *try-rerun*: Public special variables
Special Variable, *try-stream*: Public special variables
Special Variable, @cancelled-nlx: Private special variables
Special Variable, @funcallable-instance: Private special variables
Special Variable, @function-designator: Private special variables
Special Variable, @non-local-exit: Private special variables
Special Variable, @try-manual: Public special variables
Special Variable, @try/automatic-captures: Public special variables
Special Variable, @try/captures: Public special variables
Special Variable, @try/categories: Public special variables
Special Variable, @try/check-library: Public special variables
Special Variable, @try/check-restarts: Public special variables
Special Variable, @try/check-utilities: Public special variables
Special Variable, @try/checking-conditions: Public special variables
Special Variable, @try/checks: Public special variables
Special Variable, @try/collect: Public special variables
Special Variable, @try/comparing-floats: Public special variables
Special Variable, @try/concrete-events: Public special variables
Special Variable, @try/count: Public special variables
Special Variable, @try/errors: Public special variables
Special Variable, @try/event-glue: Public special variables
Special Variable, @try/event-restarts: Public special variables
Special Variable, @try/events: Public special variables
Special Variable, @try/explicit-captures: Public special variables
Special Variable, @try/explicit-try: Public special variables
Special Variable, @try/format-specifier-forms: Public special variables
Special Variable, @try/glossary: Public special variables
Special Variable, @try/implementation-notes: Public special variables
Special Variable, @try/implicit-try: Public special variables
Special Variable, @try/implicit-try-implementation: Public special variables
Special Variable, @try/is: Public special variables
Special Variable, @try/links: Public special variables
Special Variable, @try/middle-layer-of-events: Public special variables
Special Variable, @try/misc-checks: Public special variables
Special Variable, @try/outcome-restarts: Public special variables
Special Variable, @try/outcomes: Public special variables
Special Variable, @try/print: Public special variables
Special Variable, @try/printing-events: Public special variables
Special Variable, @try/replay: Public special variables
Special Variable, @try/rerun: Public special variables
Special Variable, @try/testables: Public special variables
Special Variable, @try/tests: Public special variables
Special Variable, @try/trial-events: Public special variables
Special Variable, @try/trial-restarts: Public special variables
Special Variable, @try/trial-verdicts: Public special variables
Special Variable, @try/trials: Public special variables
Special Variable, @try/tutorial: Public special variables
Special Variable, @try/writing-automatic-capture-rules: Public special variables
stream: Private classes
subform: Public structures

T
test-name: Public conditions
test-name: Public classes
to-be-described: Public classes
trial: Public conditions
trial: Private structures
trial-print-states: Private classes
trial-start: Public classes

V
valuesp: Public structures
var: Public structures
variable-bindings: Private classes
verdict: Public classes

Jump to:   !   *   @  
A   B   C   D   E   F   H   I   L   M   N   P   R   S   T   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   %  
A   B   C   D   E   F   G   I   L   M   N   O   P   R   S   T   U   V   W  
Index Entry  Section

%
%collector: Private structures

A
abort*: Public conditions
asdf.lisp: The try․asdf/asdf․lisp file

B
basic-error*-outcome: Private types
basic-outcome: Private types

C
checks.lisp: The try/checks․lisp file
Class, dummy-with-print-object: Private classes
Class, line/column-character-output-stream: Private classes
Class, printer: Private classes
Class, tree-printer: Public classes
Class, trial: Public classes
Class, wrapped-stream: Private classes
collect.lisp: The try/collect․lisp file
Condition, abort*: Public conditions
Condition, dismissal: Public conditions
Condition, error*: Public conditions
Condition, event: Public conditions
Condition, expected: Public conditions
Condition, expected-result-failure: Public conditions
Condition, expected-result-success: Public conditions
Condition, expected-verdict-failure: Public conditions
Condition, expected-verdict-success: Public conditions
Condition, failure: Public conditions
Condition, leaf: Public conditions
Condition, nlx: Public conditions
Condition, outcome: Public conditions
Condition, result: Public conditions
Condition, result-abort*: Public conditions
Condition, result-failure: Private conditions
Condition, result-skip: Public conditions
Condition, result-success: Private conditions
Condition, skip: Public conditions
Condition, success: Public conditions
Condition, trial-event: Public conditions
Condition, trial-start: Public conditions
Condition, try-internal-error: Private conditions
Condition, unexpected: Public conditions
Condition, unexpected-result-failure: Public conditions
Condition, unexpected-result-success: Public conditions
Condition, unexpected-verdict-failure: Public conditions
Condition, unexpected-verdict-success: Public conditions
Condition, unhandled-error: Public conditions
Condition, verdict: Public conditions
Condition, verdict-abort*: Public conditions
Condition, verdict-failure: Private conditions
Condition, verdict-skip: Public conditions
Condition, verdict-success: Private conditions
count.lisp: The try/count․lisp file
counter: Private structures

D
debug.lisp: The try/debug․lisp file
dismissal: Public conditions
dummy-with-print-object: Private classes

E
early.lisp: The try/early․lisp file
error*: Public conditions
error.lisp: The try/error․lisp file
event: Public conditions
events.lisp: The try/events․lisp file
expected: Public conditions
expected-failure: Public types
expected-result-failure: Public conditions
expected-result-success: Public conditions
expected-success: Public types
expected-verdict-failure: Public conditions
expected-verdict-success: Public conditions

F
fail: Public types
failure: Public conditions
File, asdf.lisp: The try․asdf/asdf․lisp file
File, checks.lisp: The try/checks․lisp file
File, collect.lisp: The try/collect․lisp file
File, count.lisp: The try/count․lisp file
File, debug.lisp: The try/debug․lisp file
File, early.lisp: The try/early․lisp file
File, error.lisp: The try/error․lisp file
File, events.lisp: The try/events․lisp file
File, floats.lisp: The try/floats․lisp file
File, gray-stream.lisp: The try/gray-stream․lisp file
File, is.lisp: The try/is․lisp file
File, manual.lisp: The try/manual․lisp file
File, outcome.lisp: The try/outcome․lisp file
File, package.lisp: The try/package․lisp file
File, print.lisp: The try/print․lisp file
File, replay.lisp: The try/replay․lisp file
File, rerun.lisp: The try/rerun․lisp file
File, result.lisp: The try/result․lisp file
File, test.lisp: The try/test․lisp file
File, testable.lisp: The try/testable․lisp file
File, trial-event.lisp: The try/trial-event․lisp file
File, trial.lisp: The try/trial․lisp file
File, try.asd: The try/try․asd file
File, try.asdf.asd: The try․asdf/try․asdf․asd file
File, try.lisp: The try/try․lisp file
File, util.lisp: The try/util․lisp file
floats.lisp: The try/floats․lisp file

G
gray-stream.lisp: The try/gray-stream․lisp file

I
is.lisp: The try/is․lisp file

L
leaf: Public conditions
line/column-character-output-stream: Private classes

M
manual.lisp: The try/manual․lisp file

N
nlx: Public conditions

O
outcome: Public conditions
outcome.lisp: The try/outcome․lisp file

P
Package, try: The try package
Package, try/asdf: The try/asdf package
package.lisp: The try/package․lisp file
pass: Public types
print-state: Private structures
print.lisp: The try/print․lisp file
printer: Private classes

R
replay.lisp: The try/replay․lisp file
rerun.lisp: The try/rerun․lisp file
result: Public conditions
result-abort*: Public conditions
result-failure: Private conditions
result-skip: Public conditions
result-success: Private conditions
result.lisp: The try/result․lisp file

S
skip: Public conditions
Structure, %collector: Private structures
Structure, counter: Private structures
Structure, print-state: Private structures
Structure, sub: Public structures
sub: Public structures
success: Public conditions
System, try: The try system
System, try.asdf: The try․asdf system

T
test.lisp: The try/test․lisp file
testable.lisp: The try/testable․lisp file
tree-printer: Public classes
trial: Public classes
trial-event: Public conditions
trial-event.lisp: The try/trial-event․lisp file
trial-start: Public conditions
trial.lisp: The try/trial․lisp file
try: The try system
try: The try package
try-internal-error: Private conditions
try.asd: The try/try․asd file
try.asdf: The try․asdf system
try.asdf.asd: The try․asdf/try․asdf․asd file
try.lisp: The try/try․lisp file
try/asdf: The try/asdf package
Type, basic-error*-outcome: Private types
Type, basic-outcome: Private types
Type, expected-failure: Public types
Type, expected-success: Public types
Type, fail: Public types
Type, pass: Public types
Type, unexpected-failure: Public types
Type, unexpected-success: Public types
Type, valid-type-specifier: Private types

U
unexpected: Public conditions
unexpected-failure: Public types
unexpected-result-failure: Public conditions
unexpected-result-success: Public conditions
unexpected-success: Public types
unexpected-verdict-failure: Public conditions
unexpected-verdict-success: Public conditions
unhandled-error: Public conditions
util.lisp: The try/util․lisp file

V
valid-type-specifier: Private types
verdict: Public conditions
verdict-abort*: Public conditions
verdict-failure: Private conditions
verdict-skip: Public conditions
verdict-success: Private conditions

W
wrapped-stream: Private classes

Jump to:   %  
A   B   C   D   E   F   G   I   L   M   N   O   P   R   S   T   U   V   W