Skip to content

Add proptest property-based tests for NETSUKE_NINJA resolver invariants #383

Description

@coderabbitai

Background

The NETSUKE_NINJA feature (implemented in PR #323, closes #83) added example-based tests for the two common cases (unset env var, valid override). However, the resolver has an input-state invariant across the full space of env-var values (empty string, non-UTF-8, absolute path, bare name, path with spaces, etc.) that example-based tests do not cover.

Required work

Add property-based tests using proptest that:

  1. Generate arbitrary valid and invalid values for NETSUKE_NINJA.
  2. Assert that the resolved program (output of resolve_ninja_program / resolve_ninja_program_utf8) matches the value logged in the "Executing command:" trace line in all cases.
  3. Assert that when NETSUKE_NINJA is unset or contains a non-UTF-8 / non-representable value the resolved program falls back to "ninja".
  4. Target both src/runner/process/mod.rs (unit level) and a suitable binary-level test in tests/.

Acceptance criteria

  • At least one proptest covering the resolver invariant: resolved program == logged program for all valid non-empty NETSUKE_NINJA values.
  • At least one proptest covering the fallback invariant: invalid / absent NETSUKE_NINJA always resolves to "ninja".
  • Tests pass under cargo test.
  • No broad lint suppressions beyond narrowly scoped #[expect(...)] with reasons.

Backlinks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions