test(skills): make path assertion portable across separators

The render-skills test asserted `rendered.contains("test-skill/SKILL.md")`
which only matched on Unix; Windows uses backslashes via Path::display(),
so the assertion failed only in CI on windows-latest.

Build the expected substring through PathBuf::display() so the assertion
matches the platform-correct separator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hunter Bown
2026-05-01 01:49:04 -05:00
parent bf6d82e4ba
commit 9a39e69c4d
+12 -1
View File
@@ -319,9 +319,20 @@ mod tests {
crate::skills::render_available_skills_context(&tmpdir.path().join("skills"))
.expect("skill context");
let expected_path = tmpdir
.path()
.join("skills")
.join("test-skill")
.join("SKILL.md")
.display()
.to_string();
assert!(rendered.contains("## Skills"));
assert!(rendered.contains("- test-skill: A test skill"));
assert!(rendered.contains("test-skill/SKILL.md"));
assert!(
rendered.contains(&expected_path),
"expected path {expected_path:?} not in rendered output"
);
assert!(rendered.contains("### How to use skills"));
}