Skip to content

test(build): harden errors_when_no_cargo_toml against TMPDIR in Rust project #178

@rocketman-code

Description

@rocketman-code

Context

The errors_when_no_cargo_toml test in tests/project_root.rs creates a tempdir and asserts that find_project_root returns an error. If TMPDIR is set to a path under a Rust project (possible in some CI environments or nix shells), the walk-up would find an ancestor Cargo.toml and the test would pass unexpectedly.

Impact

Latent test fragility, not a current failure. Standard CI environments and local dev setups are unaffected.

Suggestion

Create a sentinel boundary or assert the found root is within the expected tree if the call succeeds unexpectedly.

Discovered during review of PR #174.

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