Luigit
repositories / termux-janitor

termux-janitor

Interactive cleanup assistant for Termux: transparent, safe, confirmed disk reclamation.

owned by admin

spec/fixtures/cli/help.md

Raw
Rendered preview

Command help

Fixture: fixture-cli-help@2

Given

The built termux-janitor executable starts with standard input disconnected from a terminal and an empty isolated working directory.

The executable receives exactly one argument, --help.

When

The executable starts.

Required invariants

  • INV-HELP-SUCCESS: The process exits with the registered success status.
  • INV-HELP-STDOUT: Standard output equals the concise help generated from the canonical CLI registry.
  • INV-HELP-OPTIONS: The help names every registered option with its argument and summary.

Forbidden effects

  • NO-HELP-STDERR: Standard error remains empty.
  • NO-HELP-FIXTURE-MUTATION: The isolated working directory remains empty.

Instrumentation

try fixture.given_program("termux-janitor");
try fixture.given_standard_input(.ignored);
try fixture.given_working_directory(.empty);
try fixture.given_arguments(&.{"--help"});
try fixture.when_run();
try fixture.then_inv_help_success();
try fixture.then_inv_help_stdout(.generated_cli_help);
try fixture.then_inv_help_options();
try fixture.forbid_no_help_stderr();
try fixture.forbid_no_help_fixture_mutation();

Variations

Additional arguments, duplicated --help, other options, and operands are separate usage-error scenarios.

Limitations

This fixture detects output, status, terminal dependence, and writes beneath its isolated working directory. It does not trace system calls or prove the absence of reads and writes elsewhere.

# Command help

**Fixture:** `fixture-cli-help@2`

## Given

The built `termux-janitor` executable starts with standard input disconnected from a terminal and an
empty isolated working directory.

The executable receives exactly one argument, `--help`.

## When

The executable starts.

## Required invariants

- **`INV-HELP-SUCCESS`:** The process exits with the registered success status.
- **`INV-HELP-STDOUT`:**
  Standard output equals the concise help generated from the canonical CLI registry.
- **`INV-HELP-OPTIONS`:**
  The help names every registered option with its argument and summary.

## Forbidden effects

- **`NO-HELP-STDERR`:** Standard error remains empty.
- **`NO-HELP-FIXTURE-MUTATION`:**
  The isolated working directory remains empty.

## Instrumentation

```zig tj-test
try fixture.given_program("termux-janitor");
try fixture.given_standard_input(.ignored);
try fixture.given_working_directory(.empty);
try fixture.given_arguments(&.{"--help"});
try fixture.when_run();
try fixture.then_inv_help_success();
try fixture.then_inv_help_stdout(.generated_cli_help);
try fixture.then_inv_help_options();
try fixture.forbid_no_help_stderr();
try fixture.forbid_no_help_fixture_mutation();
```

## Variations

Additional arguments, duplicated `--help`, other options, and operands are separate usage-error
scenarios.

## Limitations

This fixture detects output, status, terminal dependence, and writes beneath its isolated working
directory. It does not trace system calls or prove the absence of reads and writes elsewhere.