Skip to content

proptastic example

Pin a saved counterexample as an example in the property's code, or propose it for a person to accept; with no ID, list what's waiting. A pinned line is checked by running the property again, and taken out if it doesn't compile. With CI set, it proposes but never pins.

Usage

Terminal window
proptastic example [ID] [DIR] [OPTIONS]
Terminal window
proptastic example
proptastic example c4f1a2b9e
proptastic example c4f1a2b9e --propose --reason="empty carts"

Output

As the command printed it, run on a sample project: each is held to a real run by the command's own tests.

Terminal window
proptastic example
Counterexamples ───────────────────────────────────────────────────────
c890c8808 CalendarTest#novemberHas30Days year = 1
pin it: .example(1)
Next: proptastic example c890c8808 · or propose: proptastic example c890c8808 --propose --reason="<why>"
Terminal window
proptastic example c890c8808 --propose --reason="November has 30 days in every year"
proposed c890c8808 for CalendarTest#novemberHas30Days, in .proptastic/proposals.yaml:
.example(1).via("proptastic: c890c8808")
for a person to accept, once the pull request is reviewed:
proptastic example c890c8808 --accept
To take it back:
proptastic example c890c8808 --remove

Exit status

0 when pinned, proposed, accepted, removed or pruned, or the list shown; 1 for a refusal that did nothing, or a pinned line that didn't compile, which was taken out again; 2 for a mistake in the command, the environment or a file; 4 when proptastic itself went wrong. The errors behind 2, 3 and the refusals are on Command errors; every code is on Environment and exit codes.

Options

--edition=EDITION

Which edition's build to run, when DIR's build files could be either's.

One of java, rust, swift.

Terminal window
proptastic example c4f1a2b9e --edition=java

--propose

Propose the example for a person to accept, rather than pin it: a coding agent's way.

Terminal window
proptastic example c4f1a2b9e --propose --reason="empty carts"

--reason=WHY

Why this input belongs in the spec, kept with the proposal; --propose needs one.

Terminal window
proptastic example c4f1a2b9e --propose --reason="empty carts"

--accept

Accept a proposed example: pin it as proposed, and check it.

Terminal window
proptastic example c4f1a2b9e --accept

--remove

Take back a proposal, or an example proptastic pinned if its line hasn't changed.

Terminal window
proptastic example c4f1a2b9e --remove

--prune

Example: drop the counterexamples and proposals whose property has gone or whose line changed; corpus: drop orphans, hold each property to its cap, and keep a minimal cover.

Terminal window
proptastic example --prune

--format=FORMAT

How proptastic answers: agent for coding agents, jsonl for tools; full on a terminal, concise elsewhere.

One of full, concise, agent, jsonl.

When it isn't given: PROPTASTIC_FORMAT, PROPTASTIC_AGENT.

Terminal window
proptastic example c4f1a2b9e --format=agent

--color=WHEN

Sets PROPTASTIC_COLOR: whether what proptastic and the properties print is in colour, auto when not given.

One of auto, always, never.

When it isn't given: PROPTASTIC_COLOR, NO_COLOR, FORCE_COLOR.

Terminal window
proptastic example c4f1a2b9e --color=never

Privacy