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:
- Generate arbitrary valid and invalid values for
NETSUKE_NINJA.
- 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.
- Assert that when
NETSUKE_NINJA is unset or contains a non-UTF-8 / non-representable value the resolved program falls back to "ninja".
- 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
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
proptestthat:NETSUKE_NINJA.resolve_ninja_program/resolve_ninja_program_utf8) matches the value logged in the "Executing command:" trace line in all cases.NETSUKE_NINJAis unset or contains a non-UTF-8 / non-representable value the resolved program falls back to"ninja".src/runner/process/mod.rs(unit level) and a suitable binary-level test intests/.Acceptance criteria
proptestcovering the resolver invariant: resolved program == logged program for all valid non-emptyNETSUKE_NINJAvalues.proptestcovering the fallback invariant: invalid / absentNETSUKE_NINJAalways resolves to"ninja".cargo test.#[expect(...)]with reasons.Backlinks