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:
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user