Skip to content

Adopt camino/cap-std path types across the integration test suite #418

Description

@lodyai

Context

During the review of #415 (broaden the static-regex lint guard, closes #410), CodeRabbit suggested migrating the new tests/static_regex_lint.rs from std::path/std::fs to camino path types and cap_std::fs_utf8 APIs.

This was deferred from that PR because doing it for one new test file in isolation would:

  • add two dependencies (camino, cap-std) that are currently absent from the tree (Cargo.lock has zero references), and
  • diverge from the rest of the integration suite, which consistently uses std::fs/std::path and tempfile (for example tests/cli.rs),

so it fell outside the minimal-change scope of the lint fix.

Proposal

If UTF-8 path guarantees and capability-scoped filesystem access are desired, adopt them suite-wide rather than piecemeal:

  • Add camino and cap-std as dev-dependencies.
  • Migrate the integration tests under tests/ from std::path::{Path, PathBuf} to camino::{Utf8Path, Utf8PathBuf}.
  • Replace ad hoc std::fs calls with cap_std::fs_utf8 equivalents, preserving existing Command execution and TempDir handling.
  • Establish the convention (e.g. in the developers guide) so new tests follow it.

Acceptance criteria

  • camino/cap-std added as dev-dependencies with a rationale recorded.
  • Integration tests use Utf8Path/Utf8PathBuf and cap_std::fs_utf8 consistently, with no behavioural regressions.
  • The convention is documented so the suite stays consistent.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestmediumCould be disruptive, but might not happenrefactor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions