Skip to content

test: drop environment assumptions from fixtures - #6

Merged
KiryuuLight merged 2 commits into
devfrom
test/environment-independent-fixtures
Jul 27, 2026
Merged

KiryuuLight merged 2 commits into
devfrom
test/environment-independent-fixtures

Conversation

@KiryuuLight

Copy link
Copy Markdown
Contributor

Two tests depended on the environment they were written in.

  • ui/log.rs wrapping fixtures hardcoded /home/light. The path is never read — the tests only care about string length — and it shipped in the 0.1.1 crate on crates.io.
  • paths.rs::user_placeholder_matches_the_environment called env::var("USER").unwrap(), which panics wherever USER isn't set: build sandboxes, minimal containers, some su/cron setups. The test also disagreed with the implementation, which falls back to LOGNAME and then leaves {user} literal. It now checks the same sources the implementation does and asserts the literal-passthrough case.

Verified with cargo test both normally and under env -u USER -u LOGNAME — 69 passing either way.

@KiryuuLight
KiryuuLight merged commit 0a31524 into dev Jul 27, 2026
1 check passed
@KiryuuLight
KiryuuLight deleted the test/environment-independent-fixtures branch July 30, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant