[ahma_mcp] fix: drop the hardcoded path separator in expand_home tests - #554
Merged
Conversation
`test_expand_home` asserted `expanded.ends_with("/test")`. #542 routed this
module's `expand_home` through `ahma_common::config::expand_home`, which joins
with `PathBuf::push` instead of the previous `replacen("~", home, 1)`. On
Windows that changed the result from `C:\Users\x/test` (mixed separators, the
literal `/` preserved from the input) to `C:\Users\x\test`, so the assertion
failed.
The new behaviour is the correct one — a canonical platform separator rather
than a mixed-separator path — so the test is what was wrong. It is exactly the
assumption AGENTS.md rules out: "Use `MAIN_SEPARATOR`/`Path` APIs, never string
separator assumptions." Both this test and its `~\` sibling now compare against
`std::path::MAIN_SEPARATOR`.
This was the sole failure in the post-merge Windows matrix for 0.19.1
(4352/4353 passed), and it cascaded through `CI green` to skip `Publish
Release`, so v0.19.1 was never published. The release gate keys on whether the
tag exists rather than on the version changing, so landing this re-triggers the
0.19.1 build and publish without a further bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
test_expand_homeassertedexpanded.ends_with("/test"). #542 routed this module'sexpand_homethroughahma_common::config::expand_home, which joins withPathBuf::pushinstead of the previousreplacen("~", home, 1).On Windows that changed the result from
C:\Users\x/test(mixed separators — the literal/survived from the input) toC:\Users\x\test, so the assertion failed.Why fix the test, not the code
The new behaviour is the correct one: a canonical platform separator beats a mixed-separator path, which is the sort of thing that later trips
Path::starts_withcomparisons. The test carried the assumption AGENTS.md explicitly rules out:Both
test_expand_homeand its~\sibling now compare againststd::path::MAIN_SEPARATOR.Release impact
This was the only failure in the post-merge Windows matrix for 0.19.1 — 4352/4353 passed — and it cascaded through
CI greento skipPublish Release. v0.19.1 was never published.job-release-gatekeys on whether tagv0.19.1exists rather than on the version changing in the push, so landing this re-triggers the 0.19.1 build and publish with no further bump.Verification
cargo fmt --all,cargo clippy --all-targets— cleancargo nextest run— 4669/4669 passedcargo nextest run --workspace --run-ignored all— 4680/4680 passedcargo denynot run: noCargo.toml/Cargo.lockchangeLocal runs are macOS, so they confirm no regression but cannot prove the Windows fix — the post-merge matrix is the real check.