Common Lisp Package: CL-QUICKCHECK

README:

cl-quickcheck - a Common Lisp port of the QuickCheck unit test framework

HOMEPAGE

http://www.yellosoft.us/quickcheck

EXAMPLE

> (load "loadme.lisp")  
T 

FUNCTION

Public

COLLECT-TEST-RESULTS (FN)

Call FN with *TESTING* true, and return a list of the test results.

GENERATE (GENERATOR)

Ask GENERATOR to produce a value.

REPORT (TEST-CASES)

Print out the interesting test results in longer form.

TEST-BINDINGS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TEST-DETAIL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TEST-FLOPPED (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TEST-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

A-CHAR

A-LIST (GENERATOR)

A-MEMBER (&REST GENERATORS)

A-STRING

A-SYMBOL

A-TUPLE (&REST GENERATORS)

SETFTEST-BINDINGS (NEW-VALUE INSTANCE)

SETFTEST-DETAIL (NEW-VALUE INSTANCE)

SETFTEST-FLOPPED (NEW-VALUE INSTANCE)

SETFTEST-NAME (NEW-VALUE INSTANCE)

Private

ANSWER (NAME FLOPPED &OPTIONAL (DETAIL (LAMBDA () T)))

Log a test outcome, with appropriate interactive side effects.

CALL-TESTER (PASSP-FN)

Call PASSP-FN and return whether it flopped.

COLLECT-DUPS (TESTS)

Return a hashtable from names of elements of TESTS to lists of the elements with the same name.

CONCAT-SYMBOL (&REST PARTS)

Intern a symbol by catenating PARTS.

DEFAULT-GENERATOR (NAME)

Give a generator expression for a name that's missing an explicit one. You'll have to define the meaning of this shorthand elsewhere.

DISTRIBUTION (TESTS)

Count test cases failed, skipped, passed, and total.

HASH-TABLE-VALUES (TABLE)

Return a list of TABLE's values in arbitrary order.

JUDGEDP (OPT-COUNT)

OPT-COUNT describes a repeated test: NIL if it ever failed, otherwise a count of passed trials. Return true iff the test has either passed *NUM-TRIALS* times or failed at least once.

NORMALIZE-BINDING (BINDING)

Return BINDING's pair of name and generator expression.

RUN-FOR-ALL (TEST-FN VARS &REST GENERATORS)

Repeatedly call TEST-FN with VARS bound to values from GENERATORS.

RUN-IS-TESTER (NAME FN-FN)

Return a test outcome from the result of FN-FN, which returns a list of a function to call for the actual test, plus its arguments.

RUN-ONLY-IF (FLAG-NAME FLAG-FN NAME TEST-FN)

Behavior of the ONLY-IF macro.

RUN-QUICKCHECK (FN)

Call FN to run a test suite, and report the result.

RUN-SHOULD-SIGNAL (NAME EXPECTED-CONDITION FN)

Test that calling FN signals (a subtype of) EXPECTED-CONDITION.

RUN-TESTER (NAME PASSP-FN)

Return a test outcome from calling PASSP-FN.

RUN-TRIAL (TEST-FN VARS GENERATORS)

Run one trial of a FOR-ALL test.

SHOW-PROGRESS (FLOPPED)

Write a single character as a bird's-eye view of a test result.

SORT-OUT (TESTS)

Collect the test cases of TESTS into separate lists by name, and return them in order of the first appearance of a case with that name.

SUMMARIZE-TEST (CASES)

Report the results of the test cases of a test, if they're interesting.

UNIQUE-NAMES (TESTS)

Return the test-names of TESTS, in order of first appearance.

VERDICT (TESTS)

Choose the most significant result from TESTS: failed, passed, or skipped, in that order.

Undocumented

CLASSIFY (FLOPPED)

COPY-TEST (INSTANCE)

INTERCEPT-ERRORS (FN)

IS-MACRO (FORM FN OPERANDS)

MAKE-TEST (&KEY ((NAME DUM187) NIL) ((FLOPPED DUM188) NIL) ((DETAIL DUM189) NIL) ((BINDINGS DUM190) NIL))

RANDOM-ELEMENT (LIST)

RUN-NAMED (NAME FN)

SUMMARIZE-ALL (VERDICTS)

TALLY (TEST OPT-COUNT)

TEST-FAILED (TEST)

TEST-P (OBJECT)

TEST-PASSED (TEST)

TEST-SKIPPED (TEST)

UPDATE-BINDINGS (TEST BINDINGS)

UPDATE-NAME (TEST NAME)

MACRO

Public

DEFINE (BINDING &BODY BODY)

Like Scheme's top-level DEFINE, more or less.

FOR-ALL (BINDINGS &BODY BODY)

Perform the test in BODY for random values of BINDINGS.

IS (FN &REST OPERANDS)

Test that FN applied to OPERANDS is true, with the failure message detailing the failing arguments.

IS= (X Y)

Test that X is EQUAL to Y.

ISNT (FN &REST OPERANDS)

Test that FN applied to OPERANDS is false.

ISNT= (X Y)

Test that X is not EQUAL to Y.

NAMED (NAME &BODY TESTS)

Perform the given TESTS with all the test names set to NAME.

ONLY-IF (FLAG TEST)

Perform the TEST only if FLAG is true, otherwise return a SKIPPED test result whose name is TEST quoted.

PICK-WEIGHTED (&BODY CHOICES)

Given CHOICES with constant weights, pick a random one at runtime.

QUICKCHECK (&BODY BODY)

Run BODY and report the results of any tests.

SHOULD-SIGNAL (CONDITION &BODY BODY)

Test that evaluating BODY signals (a subtype of) CONDITION.

TEST (FLAG)

Test that FLAG is true.

WRAP-EACH (WRAPPER &BODY WRAPPEES)

Perform each of the WRAPPEES as if surrounded by WRAPPER (with the literal symbol WRAPPEE inside WRAPPER being the hole where the wrappee appears). This is useful for factoring out common setup/teardown code for a sequence of tests without compromising their isolation.

Private

LET-DFV (((NAME PARAMS &BODY BODY1)) &BODY BODY2)

Bind a dynamic function variable, with CALL-NEXT-FUNCTION in its body calling the same variable as bound in the enclosing dynamic scope.

Undocumented

CAPTURE-STDOUT (&BODY BODY)

VARIABLE

Public

*BREAK-ON-FAILURE*

When true, test failures jump us immediately into the debugger.

*LOUD*

When true, we show progress as tests are run with dots to stdout.

*NUM-TRIALS*

Number of random trials we want to see pass in FOR-ALL tests.

*SIZE*

Bounds the size of random test cases in a generator-dependent way.

*TESTING*

When true, we're in the dynamic extent of a quickcheck form.

Undocumented

A-BOOLEAN

A-REAL

AN-INDEX

AN-INTEGER

K-GENERATOR

M-GENERATOR

N-GENERATOR

Private

*LOGGER*

Function to do whatever's appropriate with the result of each test as it completes.

CLASS

Public

Undocumented

TEST (FLAG)